summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-08-09 13:44:49 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-08-09 12:25:11 +0000
commit68e8a56b3b6110e949943d1d7795a71069c84f12 (patch)
treebbd988105d3fe6765a568a076ca77e6f0b4e5cd0
parent6f5c5a56dbef6545dedea1948771000698bcab5d (diff)
downloadqt-creator-68e8a56b3b6110e949943d1d7795a71069c84f12.tar.gz
ProjectExplorer: Introduce an "essential" flag for RunWorker
An essential RunWorker triggers the whole RunControl to stop if it spontaneously stops. Change-Id: Ia05b927e306022e99b45cc8cd7ab9636f4d3c129 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp15
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h3
2 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index 0359bbd72b..8a08688fd4 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -547,6 +547,7 @@ public:
int stopWatchdogInterval = 0; // 5000;
int stopWatchdogTimerId = -1;
bool supportsReRunning = true;
+ bool essential = false;
};
enum class RunControlState
@@ -954,6 +955,10 @@ void RunControlPrivate::onWorkerStopped(RunWorker *worker)
if (state == RunControlState::Finishing || state == RunControlState::Stopping) {
continueStopOrFinish();
return;
+ } else if (worker->isEssential()) {
+ debugMessage(workerId + " is essential. Stopping all others.");
+ initiateStop();
+ return;
}
for (RunWorker *dependent : worker->d->stopDependencies) {
@@ -1701,6 +1706,16 @@ QString RunWorker::userMessageForProcessError(QProcess::ProcessError error, cons
return msg;
}
+bool RunWorker::isEssential() const
+{
+ return d->essential;
+}
+
+void RunWorker::setEssential(bool essential)
+{
+ d->essential = essential;
+}
+
void RunWorker::start()
{
reportStarted();
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index 0eda5b396a..80c1631d63 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -353,6 +353,9 @@ public:
static QString userMessageForProcessError(QProcess::ProcessError, const QString &programName);
+ bool isEssential() const;
+ void setEssential(bool essential);
+
signals:
void started();
void stopped();