aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vcsbase
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2018-10-10 14:32:00 +0200
committerNikolai Kosjar <nikolai.kosjar@qt.io>2018-10-16 06:40:43 +0000
commitd67ddfb5d1c1d60a2ba06774d90f2ba14432e592 (patch)
tree96d4b133da62ed05fbecc86f87061653209c98d4 /src/plugins/vcsbase
parent3f3ba92fe99935dd44408076511e5d6fde603c74 (diff)
Clang: Avoid starting backend jobs for inactive app and during VCS operations
...to reduce file locking on Windows caused by clangbackend's parse/reparse jobs. Considering inactive application state should help for external VCS operations, e.g. on the command line. However, activating Qt Creator while such a VCS operation runs might still lead to undesired behavior, but this should be the less common case. VCS operations started from within Qt Creator should see less locking conflicts as we know when they start and finish. However, we just avoid starting new jobs - there might be still jobs running. Pending or new jobs will be started once Qt Creator is activated again and all VCS operations finished. Task-number: QTCREATORBUG-15449 Change-Id: I5f04c34f006e66162368efbdd58bd822a706f35e Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r--src/plugins/vcsbase/vcscommand.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp
index af1eac8f32..4d00e53ee0 100644
--- a/src/plugins/vcsbase/vcscommand.cpp
+++ b/src/plugins/vcsbase/vcscommand.cpp
@@ -29,6 +29,7 @@
#include <coreplugin/documentmanager.h>
#include <coreplugin/vcsmanager.h>
+#include <cpptools/cppmodelmanager.h>
#include <utils/synchronousprocess.h>
#include <QProcessEnvironment>
@@ -60,12 +61,16 @@ VcsCommand::VcsCommand(const QString &workingDirectory,
return proxy;
});
connect(this, &VcsCommand::started, this, [this] {
- if (flags() & ExpectRepoChanges)
+ if (flags() & ExpectRepoChanges) {
Core::DocumentManager::setAutoReloadPostponed(true);
+ CppTools::CppModelManager::instance()->setBackendJobsPostponed(true);
+ }
});
connect(this, &VcsCommand::finished, this, [this] {
- if (flags() & ExpectRepoChanges)
+ if (flags() & ExpectRepoChanges) {
Core::DocumentManager::setAutoReloadPostponed(false);
+ CppTools::CppModelManager::instance()->setBackendJobsPostponed(false);
+ }
});
}