forked from qt-creator/qt-creator
Utils: Implement FilePath::rename()
And uses it in CMake's fileapi reader. Change-Id: I9e719aa4b253eaca17c6b304eab5e7268fcfab29 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1415,6 +1415,15 @@ bool FilePath::copyFile(const FilePath &target) const
|
||||
return QFile::copy(path(), target.path());
|
||||
}
|
||||
|
||||
bool FilePath::renameFile(const FilePath &target) const
|
||||
{
|
||||
if (needsDevice()) {
|
||||
QTC_ASSERT(s_deviceHooks.renameFile, return false);
|
||||
return s_deviceHooks.renameFile(*this, target);
|
||||
}
|
||||
return QFile::rename(path(), target.path());
|
||||
}
|
||||
|
||||
QTextStream &operator<<(QTextStream &s, const FilePath &fn)
|
||||
{
|
||||
return s << fn.toString();
|
||||
|
||||
Reference in New Issue
Block a user