summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-08-09 10:46:21 +0200
committerhjk <hjk@qt.io>2017-08-10 13:17:58 +0000
commitb414b7cd3b81f30b62de9be5ab01956f3182674b (patch)
treea14c3f6835804f2b0278a0ac41e881d74fc4ca1f
parenta9d2e645179e6a94741c6be792de6ee9088d1aed (diff)
downloadqt-creator-b414b7cd3b81f30b62de9be5ab01956f3182674b.tar.gz
QmlProfiler: Merge inferior worker into LocalQmlProfilerSupport
Change-Id: Ie9f9db6ecf2891731e90326b4a27b2d819b1e7ca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp28
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.h10
2 files changed, 7 insertions, 31 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
index e8ee4c0fc2..22547568fd 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
@@ -277,13 +277,17 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl)
}
LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const QUrl &serverUrl)
- : RunWorker(runControl)
+ : SimpleTargetRunner(runControl)
{
setDisplayName("LocalQmlProfilerSupport");
m_profiler = new QmlProfilerRunner(runControl);
m_profiler->setServerUrl(serverUrl);
+
addStopDependency(m_profiler);
+ // We need to open the local server before the application tries to connect.
+ // In the TCP case, it doesn't hurt either to start the profiler before.
+ addStartDependency(m_profiler);
StandardRunnable debuggee = runnable().as<StandardRunnable>();
QString arguments = QmlDebug::qmlDebugArguments(QmlDebug::QmlProfilerServices, serverUrl);
@@ -294,27 +298,7 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
debuggee.commandLineArguments = arguments;
debuggee.runMode = ApplicationLauncher::Gui;
- m_profilee = new SimpleTargetRunner(runControl);
- m_profilee->setRunnable(debuggee);
- addStartDependency(m_profilee);
-
- // We need to open the local server before the application tries to connect.
- // In the TCP case, it doesn't hurt either to start the profiler before.
- m_profilee->addStartDependency(m_profiler);
-
- m_profilee->addStopDependency(this);
-}
-
-void LocalQmlProfilerSupport::start()
-{
- reportStarted();
- emit localRunnerStarted();
-}
-
-void LocalQmlProfilerSupport::stop()
-{
- reportStopped();
- emit localRunnerStopped();
+ setRunnable(debuggee);
}
} // namespace QmlProfiler
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
index 749d7a2241..de423c7e77 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
@@ -63,7 +63,7 @@ private:
QmlProfilerRunnerPrivate *d;
};
-class LocalQmlProfilerSupport : public ProjectExplorer::RunWorker
+class LocalQmlProfilerSupport : public ProjectExplorer::SimpleTargetRunner
{
Q_OBJECT
@@ -72,15 +72,7 @@ public:
LocalQmlProfilerSupport(ProjectExplorer::RunControl *runControl,
const QUrl &serverUrl);
- void start() override;
- void stop() override;
-
-signals:
- void localRunnerStarted();
- void localRunnerStopped();
-
private:
- ProjectExplorer::SimpleTargetRunner *m_profilee;
QmlProfilerRunner *m_profiler;
};