From bcfe1ab47469ad9cd2c69311252ce394a5b744a0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 2 Mar 2015 13:54:11 +0100 Subject: [PATCH] Disable re-run ability for analyzers. Our analyzers were designed with the assumption that only one of them is ever running (e.g. there is only one instance of the respective UI element for each Analyzer). Run controls, on the other hand, assume that an arbitrary number of them can run concurrently. With "re-run" enabled for an analyzer run control, these concepts clash. A quick test shows that some analyzers actually crash if you try to re-run them, but even if this were not the case, it could not work in a sensible way. Perhaps it would make sense to change the analyzer design so that they too can run concurrently, but not for 3.4, obviously. Change-Id: Ie8650eeef0261f2b697269900d5b465aad10aaf2 Reviewed-by: hjk Reviewed-by: Daniel Teske --- src/plugins/analyzerbase/analyzerruncontrol.h | 2 ++ src/plugins/projectexplorer/appoutputpane.cpp | 2 +- src/plugins/projectexplorer/runconfiguration.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/analyzerbase/analyzerruncontrol.h b/src/plugins/analyzerbase/analyzerruncontrol.h index fd6619a8692..066ea490835 100644 --- a/src/plugins/analyzerbase/analyzerruncontrol.h +++ b/src/plugins/analyzerbase/analyzerruncontrol.h @@ -105,6 +105,8 @@ signals: void starting(const Analyzer::AnalyzerRunControl *); private: + bool supportsReRunning() const { return false; } + ProjectExplorer::RunConfiguration *m_runConfig; AnalyzerStartParameters m_sp; }; diff --git a/src/plugins/projectexplorer/appoutputpane.cpp b/src/plugins/projectexplorer/appoutputpane.cpp index aa2877116a2..8af58af9a38 100644 --- a/src/plugins/projectexplorer/appoutputpane.cpp +++ b/src/plugins/projectexplorer/appoutputpane.cpp @@ -543,7 +543,7 @@ void AppOutputPane::enableButtons() void AppOutputPane::enableButtons(const RunControl *rc /* = 0 */, bool isRunning /* = false */) { if (rc) { - m_reRunButton->setEnabled(!isRunning); + m_reRunButton->setEnabled(!isRunning && rc->supportsReRunning()); m_reRunButton->setIcon(QIcon(rc->icon())); m_stopAction->setEnabled(isRunning); if (isRunning && debuggerPlugin() && rc->applicationProcessHandle().isValid()) { diff --git a/src/plugins/projectexplorer/runconfiguration.h b/src/plugins/projectexplorer/runconfiguration.h index 67bcae61569..4d54fd40771 100644 --- a/src/plugins/projectexplorer/runconfiguration.h +++ b/src/plugins/projectexplorer/runconfiguration.h @@ -287,6 +287,7 @@ public: virtual StopResult stop() = 0; virtual bool isRunning() const = 0; virtual QString displayName() const; + virtual bool supportsReRunning() const { return true; } void setIcon(const QString &icon) { m_icon = icon; } QString icon() const { return m_icon; }