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 <hjk@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
Christian Kandeler
2015-03-02 13:54:11 +01:00
parent c34c588438
commit bcfe1ab474
3 changed files with 4 additions and 1 deletions

View File

@@ -105,6 +105,8 @@ signals:
void starting(const Analyzer::AnalyzerRunControl *);
private:
bool supportsReRunning() const { return false; }
ProjectExplorer::RunConfiguration *m_runConfig;
AnalyzerStartParameters m_sp;
};

View File

@@ -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()) {

View File

@@ -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; }