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:
hjk
2021-06-28 13:57:10 +02:00
parent 782779f8f4
commit 54b4022987
8 changed files with 45 additions and 2 deletions

View File

@@ -311,8 +311,7 @@ void FileApiReader::makeBackupConfiguration(bool store)
if (reply.exists()) {
if (replyPrev.exists())
FileUtils::removeRecursively(replyPrev);
QDir dir;
if (!dir.rename(reply.toString(), replyPrev.toString()))
if (!reply.renameFile(replyPrev))
Core::MessageManager::writeFlashing(tr("Failed to rename %1 to %2.")
.arg(reply.toString(), replyPrev.toString()));