forked from qt-creator/qt-creator
Utils: Implement FilePath::removeRecursively
Sprinkle a few QTC_ASSERT to make sure we are in a known context. Cmake's FileApiReader uses this before moving directories as QFile::rename does not do anything if the target exists. Change-Id: I555f99e81a9fe7d93ae66145eeebfa9d5880bc51 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -310,11 +310,11 @@ void FileApiReader::makeBackupConfiguration(bool store)
|
||||
|
||||
if (reply.exists()) {
|
||||
if (replyPrev.exists())
|
||||
FileUtils::removeRecursively(replyPrev);
|
||||
replyPrev.removeRecursively();
|
||||
QTC_CHECK(!replyPrev.exists());
|
||||
if (!reply.renameFile(replyPrev))
|
||||
Core::MessageManager::writeFlashing(tr("Failed to rename %1 to %2.")
|
||||
.arg(reply.toString(), replyPrev.toString()));
|
||||
|
||||
}
|
||||
|
||||
FilePath cmakeCacheTxt = m_parameters.buildDirectory.pathAppended("CMakeCache.txt");
|
||||
|
||||
Reference in New Issue
Block a user