summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2021-06-08 10:27:53 +0200
committerCristian Adam <cristian.adam@qt.io>2021-06-08 09:34:00 +0000
commit1b3a4e1fc65ba39682912aee5d94cd30e5b9c84c (patch)
tree1007f4a47107103e92f5725f001d3626ce7c6c50
parentf087e70e80bb086931c01fc85d63f8a1ef8f770b (diff)
downloadqt-creator-1b3a4e1fc65ba39682912aee5d94cd30e5b9c84c.tar.gz
CMakePM: Clear and setup file watcher before and after backup configuration
Qt Creator 4.15 will do a backup of the CMake file-api, but the file watcher that triggers a reparsing was not cleared up before the backup. This could lead to unnecesary file-api rescans. Task-number: QTCREATORBUG-25783 Change-Id: Id91379ea85c8a91e03d952c5c66b0371ebff943f Reviewed-by: Eike Ziller <eike.ziller@qt.io>
-rw-r--r--src/plugins/cmakeprojectmanager/fileapireader.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp
index 1171b9d548..a4a2471073 100644
--- a/src/plugins/cmakeprojectmanager/fileapireader.cpp
+++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp
@@ -371,6 +371,10 @@ void FileApiReader::startCMakeState(const QStringList &configurationArguments)
connect(m_cmakeProcess.get(), &CMakeProcess::finished, this, &FileApiReader::cmakeFinishedState);
qCDebug(cmakeFileApiMode) << ">>>>>> Running cmake with arguments:" << configurationArguments;
+ // Reset watcher:
+ m_watcher.removeFiles(m_watcher.files());
+ m_watcher.removeDirectories(m_watcher.directories());
+
makeBackupConfiguration(true);
writeConfigurationIntoBuildDirectory(configurationArguments);
m_cmakeProcess->run(m_parameters, configurationArguments);
@@ -389,6 +393,8 @@ void FileApiReader::cmakeFinishedState(int code, QProcess::ExitStatus status)
if (m_lastCMakeExitCode != 0)
makeBackupConfiguration(false);
+ FileApiParser::setupCMakeFileApi(m_parameters.workDirectory, m_watcher);
+
endState(FileApiParser::scanForCMakeReplyFile(m_parameters.workDirectory));
}