forked from qt-creator/qt-creator
ProjectExplorer: Unify RunControl setup/teardown
Provide protected methods in RunControl to handle the notification of when the RunControl starts and stops. Use these helpers to move the isRunning() method into the RunConfiguration itself instead of reimplementing it everywhere. Change-Id: Ia8de42f7a6a14a049870d4e7fcb9af6756c2caa4 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -70,6 +70,7 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
|
||||
|
||||
void ValgrindRunControl::start()
|
||||
{
|
||||
reportApplicationStart();
|
||||
emit starting();
|
||||
FutureProgress *fp = ProgressManager::addTimedTask(m_progress, progressTitle(), "valgrind", 100);
|
||||
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
|
||||
@@ -101,12 +102,9 @@ void ValgrindRunControl::start()
|
||||
|
||||
if (!run->start()) {
|
||||
m_progress.cancel();
|
||||
emit finished();
|
||||
reportApplicationStop();
|
||||
return;
|
||||
}
|
||||
|
||||
m_isRunning = true;
|
||||
emit started();
|
||||
}
|
||||
|
||||
RunControl::StopResult ValgrindRunControl::stop()
|
||||
@@ -116,11 +114,6 @@ RunControl::StopResult ValgrindRunControl::stop()
|
||||
return AsynchronousStop;
|
||||
}
|
||||
|
||||
bool ValgrindRunControl::isRunning() const
|
||||
{
|
||||
return m_isRunning;
|
||||
}
|
||||
|
||||
QString ValgrindRunControl::executable() const
|
||||
{
|
||||
return runnable().as<StandardRunnable>().executable;
|
||||
@@ -161,10 +154,8 @@ void ValgrindRunControl::handleProgressFinished()
|
||||
|
||||
void ValgrindRunControl::runnerFinished()
|
||||
{
|
||||
m_isRunning = false;
|
||||
|
||||
appendMessage(tr("Analyzing finished.") + QLatin1Char('\n'), NormalMessageFormat);
|
||||
emit finished();
|
||||
reportApplicationStop();
|
||||
|
||||
m_progress.reportFinished();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user