From 8c9faaf3e5cc5ee9caec1272c8e30753141d5127 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Fri, 5 Mar 2021 11:32:47 +0100 Subject: [PATCH] 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 --- src/plugins/cmakeprojectmanager/fileapireader.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp index 152f22b468f..0657782c980 100644 --- a/src/plugins/cmakeprojectmanager/fileapireader.cpp +++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp @@ -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())); }