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:
@@ -40,7 +40,6 @@ namespace Internal {
|
||||
IosRunControl::IosRunControl(IosRunConfiguration *rc)
|
||||
: RunControl(rc, ProjectExplorer::Constants::NORMAL_RUN_MODE)
|
||||
, m_runner(new IosRunner(this, rc, false, QmlDebug::NoQmlDebugServices))
|
||||
, m_running(false)
|
||||
{
|
||||
setIcon(Utils::Icons::RUN_SMALL_TOOLBAR);
|
||||
}
|
||||
@@ -52,8 +51,7 @@ IosRunControl::~IosRunControl()
|
||||
|
||||
void IosRunControl::start()
|
||||
{
|
||||
m_running = true;
|
||||
emit started();
|
||||
reportApplicationStart();
|
||||
disconnect(m_runner, 0, this, 0);
|
||||
|
||||
connect(m_runner, &IosRunner::errorMsg,
|
||||
@@ -79,8 +77,7 @@ void IosRunControl::handleRemoteProcessFinished(bool cleanEnd)
|
||||
else
|
||||
appendMessage(tr("Run ended."), Utils::NormalMessageFormat);
|
||||
disconnect(m_runner, 0, this, 0);
|
||||
m_running = false;
|
||||
emit finished();
|
||||
reportApplicationStop();
|
||||
}
|
||||
|
||||
void IosRunControl::handleRemoteOutput(const QString &output)
|
||||
@@ -93,11 +90,6 @@ void IosRunControl::handleRemoteErrorOutput(const QString &output)
|
||||
appendMessage(output, Utils::StdErrFormat);
|
||||
}
|
||||
|
||||
bool IosRunControl::isRunning() const
|
||||
{
|
||||
return m_running;
|
||||
}
|
||||
|
||||
QString IosRunControl::displayName() const
|
||||
{
|
||||
return m_runner->displayName();
|
||||
|
||||
@@ -44,7 +44,6 @@ public:
|
||||
|
||||
void start() override;
|
||||
StopResult stop() override;
|
||||
bool isRunning() const override;
|
||||
QString displayName() const override;
|
||||
|
||||
private:
|
||||
@@ -53,7 +52,6 @@ private:
|
||||
void handleRemoteErrorOutput(const QString &output);
|
||||
|
||||
IosRunner *const m_runner;
|
||||
bool m_running;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
Reference in New Issue
Block a user