forked from qt-creator/qt-creator
QmlProfiler: Merge inferior worker into LocalQmlProfilerSupport
Change-Id: Ie9f9db6ecf2891731e90326b4a27b2d819b1e7ca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -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
|
||||
|
@@ -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;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user