QmlProfiler: Drop static accessors from QmlProfilerTool

It wasn't really a singleton even before. For testing purposes make the
client/state/model managers accessible.

Change-Id: Ie5efbc47a6b9119495f999e4e05877d4789da407
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2018-01-09 14:50:12 +01:00
parent 7d039de7a8
commit e1ad7a1784
7 changed files with 89 additions and 67 deletions

View File

@@ -106,10 +106,17 @@ void QmlProfilerPlugin::extensionsInitialized()
};
RunControl::registerWorkerCreator(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE,
[](RunControl *runControl) { return new QmlProfilerRunner(runControl); });
[this](RunControl *runControl) {
QmlProfilerRunner *runner = new QmlProfilerRunner(runControl);
connect(runner, &QmlProfilerRunner::starting,
m_profilerTool, &QmlProfilerTool::finalizeRunControl);
return runner;
});
RunControl::registerWorker<LocalQmlProfilerSupport>
(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint);
RunControl::registerWorker(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE,
[this](ProjectExplorer::RunControl *runControl) {
return new LocalQmlProfilerSupport(m_profilerTool, runControl);
}, constraint);
}
ExtensionSystem::IPlugin::ShutdownFlag QmlProfilerPlugin::aboutToShutdown()