aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorCristian Adam <[email protected]>2020-02-20 11:20:32 +0100
committerTobias Hunger <[email protected]>2020-02-20 15:41:28 +0000
commitf65f260c917e7b6034880aab3c8f216e6ab4a41e (patch)
tree1aaf24eb02b3647439728ed855d34fd8fcfdebe1 /src/plugins
parent65e244b2381fb3945efb838cf85c51aa4cfe2141 (diff)
CMakeBuildSystem: Don't re-update code model on CMakeLists.txt saves
Currently if you edit a CMakeLists.txt and then press save, the code model will be reindexed. On projects like Qt Creator this operation is quite significant. Note that the code model is updated after CMake has run on the project, which is what I would expect. Saving the CMakeLists.txt and not running CMake has no effect on the project, and the code model shoudn't be reindexed. Change-Id: I61289fda60752ef002cf3625d339d4fcaf144d1b Reviewed-by: Cristian Adam <[email protected]> Reviewed-by: Tobias Hunger <[email protected]>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp12
-rw-r--r--src/plugins/cmakeprojectmanager/fileapireader.cpp13
-rw-r--r--src/plugins/cmakeprojectmanager/servermodereader.cpp11
3 files changed, 11 insertions, 25 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
index 9f175a635fb..3d9d4808c5a 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildsystem.cpp
@@ -26,6 +26,7 @@
#include "cmakebuildsystem.h"
#include "cmakebuildconfiguration.h"
+#include "cmakekitinformation.h"
#include "cmakeproject.h"
#include "cmakeprojectconstants.h"
#include "cmakeprojectnodes.h"
@@ -204,10 +205,13 @@ CMakeBuildSystem::CMakeBuildSystem(CMakeBuildConfiguration *bc)
connect(project(), &Project::projectFileIsDirty, this, [this]() {
if (m_buildConfiguration->isActive()) {
- qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
- m_buildDirManager
- .setParametersAndRequestParse(BuildDirParameters(m_buildConfiguration),
- BuildDirManager::REPARSE_DEFAULT);
+ const auto cmake = CMakeKitAspect::cmakeTool(m_buildConfiguration->target()->kit());
+ if (cmake && cmake->isAutoRun()) {
+ qCDebug(cmakeBuildSystemLog) << "Requesting parse due to dirty project file";
+ m_buildDirManager.setParametersAndRequestParse(BuildDirParameters(
+ m_buildConfiguration),
+ BuildDirManager::REPARSE_DEFAULT);
+ }
}
});
diff --git a/src/plugins/cmakeprojectmanager/fileapireader.cpp b/src/plugins/cmakeprojectmanager/fileapireader.cpp
index 13c90abf7c2..83a81f2a70e 100644
--- a/src/plugins/cmakeprojectmanager/fileapireader.cpp
+++ b/src/plugins/cmakeprojectmanager/fileapireader.cpp
@@ -63,18 +63,7 @@ using namespace FileApiDetails;
// FileApiReader:
// --------------------------------------------------------------------
-FileApiReader::FileApiReader()
-{
- connect(Core::EditorManager::instance(),
- &Core::EditorManager::aboutToSave,
- this,
- [this](const Core::IDocument *document) {
- if (m_cmakeFiles.contains(document->filePath())) {
- qCDebug(cmakeFileApiMode) << "FileApiReader: DIRTY SIGNAL";
- emit dirty();
- }
- });
-}
+FileApiReader::FileApiReader() {}
FileApiReader::~FileApiReader()
{
diff --git a/src/plugins/cmakeprojectmanager/servermodereader.cpp b/src/plugins/cmakeprojectmanager/servermodereader.cpp
index 72c85bf271c..f86081bd382 100644
--- a/src/plugins/cmakeprojectmanager/servermodereader.cpp
+++ b/src/plugins/cmakeprojectmanager/servermodereader.cpp
@@ -73,12 +73,6 @@ const int MAX_PROGRESS = 1400;
ServerModeReader::ServerModeReader()
{
- connect(Core::EditorManager::instance(), &Core::EditorManager::aboutToSave,
- this, [this](const Core::IDocument *document) {
- if (m_cmakeFiles.contains(document->filePath()))
- emit dirty();
- });
-
connect(&m_parser, &CMakeParser::addOutput,
this, [](const QString &m) { Core::MessageManager::write(m); });
connect(&m_parser, &CMakeParser::addTask, this, [this](const Task &t) {
@@ -466,10 +460,9 @@ void ServerModeReader::handleProgress(int min, int cur, int max, const QString &
void ServerModeReader::handleSignal(const QString &signal, const QVariantMap &data)
{
+ Q_UNUSED(signal)
Q_UNUSED(data)
- // CMake on Windows sends false dirty signals on each edit (QTCREATORBUG-17944)
- if (!HostOsInfo::isWindowsHost() && signal == "dirty")
- emit dirty();
+ // We do not need to act on fileChanged signals nor on dirty signals!
}
void ServerModeReader::handleServerConnected()