CMakePM: Do not issue error message when CMakeCache.txt is missing

Only do the backup of the CMakeCache.txt and the file-api json
reply directory when they exist.

Change-Id: I0fe1098968c5b6b3a8285745452d5a24d7ded638
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-03-05 11:32:47 +01:00
parent 011bc5ce33
commit 8c9faaf3e5

View File

@@ -321,9 +321,10 @@ void FileApiReader::makeBackupConfiguration(bool store)
if (!store)
std::swap(cmakeCacheTxt, cmakeCacheTxtPrev);
if (!FileUtils::copyIfDifferent(cmakeCacheTxt, cmakeCacheTxtPrev))
Core::MessageManager::writeFlashing(tr("Failed to copy %1 to %2.")
.arg(cmakeCacheTxt.toString(), cmakeCacheTxtPrev.toString()));
if (cmakeCacheTxt.exists())
if (!FileUtils::copyIfDifferent(cmakeCacheTxt, cmakeCacheTxtPrev))
Core::MessageManager::writeFlashing(tr("Failed to copy %1 to %2.")
.arg(cmakeCacheTxt.toString(), cmakeCacheTxtPrev.toString()));
}