diff options
author | Ulf Hermann <ulf.hermann@digia.com> | 2014-03-18 13:00:21 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@digia.com> | 2014-03-19 12:29:49 +0100 |
commit | 1111c06aaccef2cad1d136b38c8c1ab48d0a5ddd (patch) | |
tree | 80a3398eb296c5816124753152825f6369d530be | |
parent | 9c180ffded29ed148c6107d4376fe61f086ad1a6 (diff) | |
download | qt-creator-1111c06aaccef2cad1d136b38c8c1ab48d0a5ddd.tar.gz |
Android: notify qml profiler when app is stopped
As we cannot determine reliably what happened to the app we drop the
"success" parameter to notifyRemoteFinished(). It was almost always
true before and where it wasn't it didn't do anything useful. The
transition from AppRunning to AppKilled without AppDying in between
was invalid and would have triggered an assertion when it happened.
Task-number: QTCREATORBUG-11760
Change-Id: Iebf4ca9bddbcc7b152131f9574bc5f2c0a8ba44f
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
-rw-r--r-- | src/plugins/analyzerbase/analyzerruncontrol.h | 2 | ||||
-rw-r--r-- | src/plugins/android/androidanalyzesupport.cpp | 7 | ||||
-rw-r--r-- | src/plugins/android/androidanalyzesupport.h | 1 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerengine.cpp | 7 | ||||
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerengine.h | 2 | ||||
-rw-r--r-- | src/plugins/qnx/qnxanalyzesupport.cpp | 2 | ||||
-rw-r--r-- | src/plugins/remotelinux/remotelinuxanalyzesupport.cpp | 2 |
7 files changed, 14 insertions, 9 deletions
diff --git a/src/plugins/analyzerbase/analyzerruncontrol.h b/src/plugins/analyzerbase/analyzerruncontrol.h index 28fb78d52c..2c9ba2af73 100644 --- a/src/plugins/analyzerbase/analyzerruncontrol.h +++ b/src/plugins/analyzerbase/analyzerruncontrol.h @@ -82,7 +82,7 @@ public: StartMode mode() const { return m_sp.startMode; } virtual void notifyRemoteSetupDone(quint16) {} - virtual void notifyRemoteFinished(bool) {} + virtual void notifyRemoteFinished() {} bool m_isRunning; diff --git a/src/plugins/android/androidanalyzesupport.cpp b/src/plugins/android/androidanalyzesupport.cpp index 7c24ecfa6f..b29299fcdb 100644 --- a/src/plugins/android/androidanalyzesupport.cpp +++ b/src/plugins/android/androidanalyzesupport.cpp @@ -102,6 +102,13 @@ void AndroidAnalyzeSupport::handleRemoteProcessStarted(int qmlPort) m_qmlPort = qmlPort; } +void AndroidAnalyzeSupport::handleRemoteProcessFinished(const QString &errorMsg) +{ + if (m_runControl) + m_runControl->notifyRemoteFinished(); + AndroidRunSupport::handleRemoteProcessFinished(errorMsg); +} + void AndroidAnalyzeSupport::handleRemoteOutput(const QByteArray &output) { const QString msg = QString::fromUtf8(output); diff --git a/src/plugins/android/androidanalyzesupport.h b/src/plugins/android/androidanalyzesupport.h index 81a6ba61c2..7ea63dd28f 100644 --- a/src/plugins/android/androidanalyzesupport.h +++ b/src/plugins/android/androidanalyzesupport.h @@ -56,6 +56,7 @@ public: private slots: void handleRemoteProcessStarted(int qmlPort); + void handleRemoteProcessFinished(const QString &errorMsg); void handleRemoteOutput(const QByteArray &output); void handleRemoteErrorOutput(const QByteArray &output); diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.cpp b/src/plugins/qmlprofiler/qmlprofilerengine.cpp index 2246832422..6ab1e0ef27 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -148,16 +148,13 @@ void QmlProfilerRunControl::stopEngine() } } -void QmlProfilerRunControl::notifyRemoteFinished(bool success) +void QmlProfilerRunControl::notifyRemoteFinished() { QTC_ASSERT(d->m_profilerState, return); switch (d->m_profilerState->currentState()) { case QmlProfilerStateManager::AppRunning : { - if (success) - d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppDying); - else - d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppKilled); + d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppDying); AnalyzerManager::stopTool(); runControlFinished(); diff --git a/src/plugins/qmlprofiler/qmlprofilerengine.h b/src/plugins/qmlprofiler/qmlprofilerengine.h index 4bba087028..2a4eac749c 100644 --- a/src/plugins/qmlprofiler/qmlprofilerengine.h +++ b/src/plugins/qmlprofiler/qmlprofilerengine.h @@ -62,7 +62,7 @@ public slots: void stopEngine(); private slots: - void notifyRemoteFinished(bool success = true); + void notifyRemoteFinished(); void cancelProcess(); void logApplicationMessage(const QString &msg, Utils::OutputFormat format); diff --git a/src/plugins/qnx/qnxanalyzesupport.cpp b/src/plugins/qnx/qnxanalyzesupport.cpp index 9f61a6b3ff..4851e296c4 100644 --- a/src/plugins/qnx/qnxanalyzesupport.cpp +++ b/src/plugins/qnx/qnxanalyzesupport.cpp @@ -113,7 +113,7 @@ void QnxAnalyzeSupport::handleRemoteProcessFinished(bool success) if (!success) showMessage(tr("The %1 process closed unexpectedly.").arg(executable()), Utils::NormalMessageFormat); - m_runControl->notifyRemoteFinished(success); + m_runControl->notifyRemoteFinished(); m_slog2Info->stop(); } diff --git a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp index 8cfdebaf3f..d72d455b4d 100644 --- a/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp +++ b/src/plugins/remotelinux/remotelinuxanalyzesupport.cpp @@ -160,7 +160,7 @@ void RemoteLinuxAnalyzeSupport::handleAppRunnerFinished(bool success) reset(); if (!success) showMessage(tr("Failure running remote process."), Utils::NormalMessageFormat); - d->runControl->notifyRemoteFinished(success); + d->runControl->notifyRemoteFinished(); } void RemoteLinuxAnalyzeSupport::handleProfilingFinished() |