aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/valgrind/valgrindengine.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2017-02-27 17:25:58 +0100
committerTobias Hunger <tobias.hunger@qt.io>2017-03-01 12:46:59 +0000
commite07c6383d7e6bc7f44e0820fa1a33a9470397a60 (patch)
tree1c3da78e0f6872e1d4de5874d60fae83672b208e /src/plugins/valgrind/valgrindengine.cpp
parent329db5f4cc1fced14aeccbd2f8f580ec8c2d26a3 (diff)
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>
Diffstat (limited to 'src/plugins/valgrind/valgrindengine.cpp')
-rw-r--r--src/plugins/valgrind/valgrindengine.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/plugins/valgrind/valgrindengine.cpp b/src/plugins/valgrind/valgrindengine.cpp
index 6e08ae66dc..fb41439943 100644
--- a/src/plugins/valgrind/valgrindengine.cpp
+++ b/src/plugins/valgrind/valgrindengine.cpp
@@ -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();