diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2017-02-27 17:25:58 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2017-03-01 12:46:59 +0000 |
commit | e07c6383d7e6bc7f44e0820fa1a33a9470397a60 (patch) | |
tree | 1c3da78e0f6872e1d4de5874d60fae83672b208e /src/plugins/android/androidruncontrol.cpp | |
parent | 329db5f4cc1fced14aeccbd2f8f580ec8c2d26a3 (diff) | |
download | qt-creator-e07c6383d7e6bc7f44e0820fa1a33a9470397a60.tar.gz |
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/android/androidruncontrol.cpp')
-rw-r--r-- | src/plugins/android/androidruncontrol.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/plugins/android/androidruncontrol.cpp b/src/plugins/android/androidruncontrol.cpp index b7d8c92004..7c5d815a16 100644 --- a/src/plugins/android/androidruncontrol.cpp +++ b/src/plugins/android/androidruncontrol.cpp @@ -41,7 +41,6 @@ namespace Internal { AndroidRunControl::AndroidRunControl(AndroidRunConfiguration *rc) : RunControl(rc, ProjectExplorer::Constants::NORMAL_RUN_MODE) , m_runner(new AndroidRunner(this, rc, ProjectExplorer::Constants::NORMAL_RUN_MODE)) - , m_running(false) { setRunnable(m_runner->runnable()); setIcon(Utils::Icons::RUN_SMALL_TOOLBAR); @@ -54,8 +53,7 @@ AndroidRunControl::~AndroidRunControl() void AndroidRunControl::start() { - m_running = true; - emit started(); + reportApplicationStart(); disconnect(m_runner, 0, this, 0); connect(m_runner, &AndroidRunner::remoteErrorOutput, @@ -79,8 +77,7 @@ void AndroidRunControl::handleRemoteProcessFinished(const QString &error) { appendMessage(error, Utils::ErrorMessageFormat); disconnect(m_runner, 0, this, 0); - m_running = false; - emit finished(); + reportApplicationStop(); } void AndroidRunControl::handleRemoteOutput(const QString &output) @@ -93,11 +90,6 @@ void AndroidRunControl::handleRemoteErrorOutput(const QString &output) appendMessage(output, Utils::StdErrFormatSameLine); } -bool AndroidRunControl::isRunning() const -{ - return m_running; -} - QString AndroidRunControl::displayName() const { return m_runner->displayName(); |