aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-04-07 11:09:12 +0200
committerhjk <hjk@qt.io>2017-04-07 10:51:35 +0000
commitcd3c5104bfa3b94b24615556ab08314e1ab5c67d (patch)
treecff1bbb536db104b8bf9e0eeda96e5b4714ccbbe
parent1779578930590536acce941eb7234012ca73c6a3 (diff)
ProjectExplorer: Add a RunControl::supportsReRunning setter
Removes one reason to derive from base RunControls (specifically ValgrindRunControl). Change-Id: I81e32a49ef30e79ee7e7b53a54021eaaba43453a Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r--src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp1
-rw-r--r--src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h1
-rw-r--r--src/plugins/projectexplorer/runconfiguration.cpp11
-rw-r--r--src/plugins/projectexplorer/runconfiguration.h4
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp1
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.h1
-rw-r--r--src/plugins/valgrind/valgrindengine.cpp1
-rw-r--r--src/plugins/valgrind/valgrindengine.h1
8 files changed, 17 insertions, 4 deletions
diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp
index 5d8b183cec..471feeef63 100644
--- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp
+++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.cpp
@@ -79,6 +79,7 @@ ClangStaticAnalyzerRunControl::ClangStaticAnalyzerRunControl(
{
setDisplayName(tr("Clang Static Analyzer"));
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
+ setSupportsReRunning(false);
Target *target = runConfiguration->target();
BuildConfiguration *buildConfiguration = target->activeBuildConfiguration();
diff --git a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h
index fca11e6c48..d35f17f19b 100644
--- a/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h
+++ b/src/plugins/clangstaticanalyzer/clangstaticanalyzerruncontrol.h
@@ -60,7 +60,6 @@ public:
void stop() override;
bool success() const { return m_success; } // For testing.
- bool supportsReRunning() const override { return false; }
signals:
void newDiagnosticsAvailable(const QList<Diagnostic> &diagnostics);
diff --git a/src/plugins/projectexplorer/runconfiguration.cpp b/src/plugins/projectexplorer/runconfiguration.cpp
index b0f665a661..2d0afcc20a 100644
--- a/src/plugins/projectexplorer/runconfiguration.cpp
+++ b/src/plugins/projectexplorer/runconfiguration.cpp
@@ -589,6 +589,7 @@ public:
Utils::ProcessHandle applicationProcessHandle;
State state = State::Initialized;
+ bool supportsReRunning = true;
#ifdef Q_OS_OSX
// This is used to bring apps in the foreground on Mac
@@ -892,6 +893,16 @@ bool RunControl::promptToStop(bool *optionalPrompt) const
optionalPrompt);
}
+bool RunControl::supportsReRunning() const
+{
+ return d->supportsReRunning;
+}
+
+void RunControl::setSupportsReRunning(bool reRunningSupported)
+{
+ d->supportsReRunning = reRunningSupported;
+}
+
bool RunControl::isRunning() const
{
return d->state == RunControlPrivate::State::Running;
diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h
index d06e33a355..1342fc4440 100644
--- a/src/plugins/projectexplorer/runconfiguration.h
+++ b/src/plugins/projectexplorer/runconfiguration.h
@@ -371,7 +371,9 @@ public:
void initiateStop(); // Calls stop() asynchronously.
virtual bool promptToStop(bool *optionalPrompt = nullptr) const;
- virtual bool supportsReRunning() const { return true; }
+
+ virtual bool supportsReRunning() const;
+ void setSupportsReRunning(bool reRunningSupported);
virtual QString displayName() const;
void setDisplayName(const QString &displayName);
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
index 1ecfa45335..aa2af74b79 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
@@ -82,6 +82,7 @@ QmlProfilerRunControl::QmlProfilerRunControl(RunConfiguration *runConfiguration,
, d(new QmlProfilerRunControlPrivate)
{
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
+ setSupportsReRunning(false);
d->m_tool = tool;
// Only wait 4 seconds for the 'Waiting for connection' on application output, then just try to connect
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
index f142994feb..69686a1e35 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
@@ -51,7 +51,6 @@ public:
void stop() override;
void cancelProcess();
void notifyRemoteFinished() override;
- bool supportsReRunning() const override { return false; }
signals:
void processRunning(Utils::Port port);
diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp
index 0ebbac6d2d..aab32c0f7d 100644
--- a/src/plugins/valgrind/valgrindengine.cpp
+++ b/src/plugins/valgrind/valgrindengine.cpp
@@ -57,6 +57,7 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
: RunControl(runConfiguration, runMode)
{
setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR);
+ setSupportsReRunning(false);
if (runConfiguration)
if (IRunConfigurationAspect *aspect = runConfiguration->extraAspect(ANALYZER_VALGRIND_SETTINGS))
diff --git a/src/plugins/valgrind/valgrindengine.h b/src/plugins/valgrind/valgrindengine.h
index 76f9e57311..0ee39dcc37 100644
--- a/src/plugins/valgrind/valgrindengine.h
+++ b/src/plugins/valgrind/valgrindengine.h
@@ -47,7 +47,6 @@ public:
void start() override;
void stop() override;
- bool supportsReRunning() const override { return false; }
QString executable() const;