diff options
author | Christiaan Janssen <christiaan.janssen@digia.com> | 2013-07-18 16:45:48 +0200 |
---|---|---|
committer | Christiaan Janssen <christiaan.janssen@digia.com> | 2013-07-19 10:09:17 +0300 |
commit | bbaa5efb6c08bd60999a1eeb7bcde11826829c79 (patch) | |
tree | eff90bcb45620be0dadb68357edf49b8b554868c | |
parent | 832e2b8d39628c54e1b6f28333b8c6cd649fdb61 (diff) |
QmlProfiler: adapt to changes in IAnalyzer interface
Said changes are introduced in patch
I5711f5a1c3a49abce23f2d78b0c4de19933e9c19 of QtCreator (current master)
Change-Id: I51e8a6d41f4cc1ce599941499aa5043796fff8a7
Reviewed-by: Christiaan Janssen <christiaan.janssen@digia.com>
-rw-r--r-- | plugins/qmlprofiler/qmlprofilerengine.cpp | 25 | ||||
-rw-r--r-- | plugins/qmlprofiler/qmlprofilerengine.h | 5 | ||||
-rw-r--r-- | plugins/qmlprofiler/qmlprofilertool.cpp | 2 |
3 files changed, 17 insertions, 15 deletions
diff --git a/plugins/qmlprofiler/qmlprofilerengine.cpp b/plugins/qmlprofiler/qmlprofilerengine.cpp index 05b702c228..18308d3178 100644 --- a/plugins/qmlprofiler/qmlprofilerengine.cpp +++ b/plugins/qmlprofiler/qmlprofilerengine.cpp @@ -64,7 +64,7 @@ namespace Internal { class QmlProfilerEngine::QmlProfilerEnginePrivate { public: - QmlProfilerEnginePrivate(QmlProfilerEngine *qq, const AnalyzerStartParameters &sp) : q(qq), m_runner(0), sp(sp) {} + QmlProfilerEnginePrivate(QmlProfilerEngine *qq) : q(qq), m_runner(0) {} ~QmlProfilerEnginePrivate() { delete m_runner; } bool attach(const QString &address, uint port); @@ -78,7 +78,6 @@ public: AbstractQmlProfilerRunner *m_runner; QTimer m_noDebugOutputTimer; QmlDebug::QmlOutputParser m_outputParser; - const AnalyzerStartParameters sp; }; AbstractQmlProfilerRunner * @@ -117,7 +116,7 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo const ProjectExplorer::IDevice::ConstPtr device = ProjectExplorer::DeviceKitInformation::device(runConfiguration->target()->kit()); QTC_ASSERT(device->type() == ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE, return 0); - conf.port = sp.analyzerPort; + conf.port = q->m_sp.analyzerPort; runner = new LocalQmlProfilerRunner(conf, parent); return runner; } @@ -126,12 +125,13 @@ QmlProfilerEngine::QmlProfilerEnginePrivate::createRunner(ProjectExplorer::RunCo // QmlProfilerEngine // -QmlProfilerEngine::QmlProfilerEngine(IAnalyzerTool *tool, - const Analyzer::AnalyzerStartParameters &sp, +QmlProfilerEngine::QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration) - : IAnalyzerEngine(tool, sp, runConfiguration) - , d(new QmlProfilerEnginePrivate(this, sp)) + : d(new QmlProfilerEnginePrivate(this)) { + m_sp = sp; + m_runConfig = runConfiguration; + d->m_profilerState = 0; // Only wait 4 seconds for the 'Waiting for connection' on application output, then just try to connect @@ -189,12 +189,12 @@ bool QmlProfilerEngine::start() } if (d->m_runner) { - connect(d->m_runner, SIGNAL(stopped()), this, SLOT(processEnded())); + connect(d->m_runner, SIGNAL(stopped()), this, SLOT(notifyRemoteFinished())); connect(d->m_runner, SIGNAL(appendMessage(QString,Utils::OutputFormat)), this, SLOT(logApplicationMessage(QString,Utils::OutputFormat))); d->m_runner->start(); d->m_noDebugOutputTimer.start(); - } else if (d->sp.startMode == StartQmlRemote) { + } else if (m_sp.startMode == StartQmlRemote) { d->m_noDebugOutputTimer.start(); } else { emit processRunning(startParameters().analyzerPort); @@ -230,13 +230,16 @@ void QmlProfilerEngine::stop() } } -void QmlProfilerEngine::processEnded() +void QmlProfilerEngine::notifyRemoteFinished(bool success) { QTC_ASSERT(d->m_profilerState, return); switch (d->m_profilerState->currentState()) { case QmlProfilerStateManager::AppRunning : { - d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppDying); + if (success) + d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppDying); + else + d->m_profilerState->setCurrentState(QmlProfilerStateManager::AppKilled); AnalyzerManager::stopTool(); emit finished(); diff --git a/plugins/qmlprofiler/qmlprofilerengine.h b/plugins/qmlprofiler/qmlprofilerengine.h index fe8cc47313..bf40b37c2f 100644 --- a/plugins/qmlprofiler/qmlprofilerengine.h +++ b/plugins/qmlprofiler/qmlprofilerengine.h @@ -42,8 +42,7 @@ class QmlProfilerEngine : public Analyzer::IAnalyzerEngine Q_OBJECT public: - QmlProfilerEngine(Analyzer::IAnalyzerTool *tool, - const Analyzer::AnalyzerStartParameters &sp, + QmlProfilerEngine(const Analyzer::AnalyzerStartParameters &sp, ProjectExplorer::RunConfiguration *runConfiguration); ~QmlProfilerEngine(); @@ -62,7 +61,7 @@ public slots: void stop(); private slots: - void processEnded(); + void notifyRemoteFinished(bool success = true); void cancelProcess(); void logApplicationMessage(const QString &msg, Utils::OutputFormat format); diff --git a/plugins/qmlprofiler/qmlprofilertool.cpp b/plugins/qmlprofiler/qmlprofilertool.cpp index a0e0cfe454..7337708daa 100644 --- a/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/plugins/qmlprofiler/qmlprofilertool.cpp @@ -228,7 +228,7 @@ IAnalyzerTool::ToolMode QmlProfilerTool::toolMode() const IAnalyzerEngine *QmlProfilerTool::createEngine(const AnalyzerStartParameters &sp, RunConfiguration *runConfiguration) { - QmlProfilerEngine *engine = new QmlProfilerEngine(this, sp, runConfiguration); + QmlProfilerEngine *engine = new QmlProfilerEngine(sp, runConfiguration); engine->registerProfilerStateManager(d->m_profilerState); |