forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -47,7 +47,6 @@ public:
|
||||
|
||||
void start() override;
|
||||
void stop() override;
|
||||
bool supportsReRunning() const override { return false; }
|
||||
|
||||
QString executable() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user