aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlprofiler
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-09-02 16:05:02 +0200
committerhjk <hjk@qt.io>2019-09-03 07:09:05 +0000
commit524a1f431c3e247a19d39d7734011d10f9873017 (patch)
treeccee423a7f3702c6e4e7ce6a76a0925a90ab72d9 /src/plugins/qmlprofiler
parentd9d18ee393f8af49e3684cc19b343846c2758856 (diff)
QmlProfiler: Use standard setup for runner setup
Code-wise no immediate advantage, but removes the need for the unusual 'started' signal. Change-Id: Ie1d99127e8fe1561c35e035894ee5dd4639d3f12 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler')
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp16
-rw-r--r--src/plugins/qmlprofiler/qmlprofilerruncontrol.h9
-rw-r--r--src/plugins/qmlprofiler/qmlprofilertool.cpp1
3 files changed, 14 insertions, 12 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
index 460766ec0f..d01bb52818 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp
@@ -88,7 +88,6 @@ QmlProfilerRunner::~QmlProfilerRunner()
void QmlProfilerRunner::start()
{
- emit starting(this);
if (!d->m_profilerState)
QmlProfilerTool::instance()->finalizeRunControl(this);
QTC_ASSERT(d->m_profilerState, return);
@@ -230,18 +229,20 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
{
setId("LocalQmlProfilerSupport");
- auto profiler = new QmlProfilerRunner(runControl);
- profiler->setServerUrl(serverUrl);
- connect(profiler, &QmlProfilerRunner::starting,
- QmlProfilerTool::instance(), &QmlProfilerTool::finalizeRunControl);
+ m_profiler = new QmlProfilerRunner(runControl);
+ m_profiler->setServerUrl(serverUrl);
- addStopDependency(profiler);
+ 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(profiler);
+ addStartDependency(m_profiler);
+}
+void LocalQmlProfilerSupport::start()
+{
Runnable debuggee = runnable();
+ QUrl serverUrl = m_profiler->serverUrl();
QString code;
if (serverUrl.scheme() == Utils::urlSocketScheme())
code = QString("file:%1").arg(serverUrl.path());
@@ -259,6 +260,7 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
debuggee.commandLineArguments = arguments;
setRunnable(debuggee);
+ SimpleTargetRunner::start();
}
} // namespace Internal
diff --git a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
index ac40e16301..d58b08b098 100644
--- a/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
+++ b/src/plugins/qmlprofiler/qmlprofilerruncontrol.h
@@ -37,7 +37,6 @@
namespace QmlProfiler {
namespace Internal {
-class QmlProfilerTool;
class QmlProfilerRunner : public ProjectExplorer::RunWorker
{
Q_OBJECT
@@ -54,9 +53,6 @@ public:
void cancelProcess();
void notifyRemoteFinished();
-signals:
- void starting(QmlProfilerRunner *self);
-
private:
void start() override;
void stop() override;
@@ -75,6 +71,11 @@ public:
LocalQmlProfilerSupport(ProjectExplorer::RunControl *runControl);
LocalQmlProfilerSupport(ProjectExplorer::RunControl *runControl,
const QUrl &serverUrl);
+
+private:
+ void start() override;
+
+ QmlProfilerRunner *m_profiler;
};
} // namespace Internal
diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp
index 4964316509..8348acb6de 100644
--- a/src/plugins/qmlprofiler/qmlprofilertool.cpp
+++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp
@@ -561,7 +561,6 @@ ProjectExplorer::RunControl *QmlProfilerTool::attachToWaitingApplication()
runControl->setRunConfiguration(RunConfiguration::startupRunConfiguration());
auto profiler = new QmlProfilerRunner(runControl);
profiler->setServerUrl(serverUrl);
- connect(profiler, &QmlProfilerRunner::starting, this, &QmlProfilerTool::finalizeRunControl);
connect(d->m_profilerConnections, &QmlProfilerClientManager::connectionClosed,
runControl, &RunControl::initiateStop);