forked from qt-creator/qt-creator
Utils: add rename function to fileutils
Change-Id: Iaf47744819c21013661e3bd0275a04c1d68e9023 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -485,6 +485,13 @@ FilePath FileUtils::homePath()
|
||||
return FilePath::fromString(QDir::cleanPath(QDir::homePath()));
|
||||
}
|
||||
|
||||
bool FileUtils::renameFile(const FilePath &srcFilePath, const FilePath &tgtFilePath)
|
||||
{
|
||||
QTC_ASSERT(!srcFilePath.needsDevice(), return false);
|
||||
QTC_ASSERT(srcFilePath.scheme() == tgtFilePath.scheme(), return false);
|
||||
return QFile::rename(srcFilePath.path(), tgtFilePath.path());
|
||||
}
|
||||
|
||||
QByteArray FileReader::fetchQrc(const QString &fileName)
|
||||
{
|
||||
QTC_ASSERT(fileName.startsWith(':'), return QByteArray());
|
||||
|
||||
Reference in New Issue
Block a user