AppMan: Inline AppManagerQmlToolingSupport

Task-number: QTCREATORBUG-29168
Change-Id: I7669d3ad685dccbdcea5917ad3b70704e248d29c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2024-11-20 19:23:30 +01:00
parent e400195ac0
commit ed77787cc3

View File

@@ -187,31 +187,6 @@ private:
} }
}; };
// AppManagerQmlToolingSupport
class AppManagerQmlToolingSupport final : public RunWorker
{
public:
explicit AppManagerQmlToolingSupport(RunControl *runControl)
: RunWorker(runControl)
{
setId("AppManagerQmlToolingSupport");
runControl->requestQmlChannel();
QmlDebugServicesPreset services = servicesForRunMode(runControl->runMode());
auto runner = createInferiorRunner(runControl, services);
addStartDependency(runner);
addStopDependency(runner);
auto worker = runControl->createWorker(runnerIdForRunMode(runControl->runMode()));
worker->addStartDependency(this);
addStopDependency(worker);
// Make sure the QML Profiler is stopped before the appman-controller
runner->addStopDependency(worker);
}
};
class AppManagerRunWorkerFactory final : public RunWorkerFactory class AppManagerRunWorkerFactory final : public RunWorkerFactory
{ {
public: public:
@@ -284,7 +259,24 @@ class AppManagerQmlToolingWorkerFactory final : public RunWorkerFactory
public: public:
AppManagerQmlToolingWorkerFactory() AppManagerQmlToolingWorkerFactory()
{ {
setProduct<AppManagerQmlToolingSupport>(); setProducer([](RunControl *runControl) {
auto worker = new RunWorker(runControl);
worker->setId("AppManagerQmlToolingSupport");
runControl->requestQmlChannel();
QmlDebugServicesPreset services = servicesForRunMode(runControl->runMode());
auto runner = createInferiorRunner(runControl, services);
worker->addStartDependency(runner);
worker->addStopDependency(runner);
auto extraWorker = runControl->createWorker(runnerIdForRunMode(runControl->runMode()));
extraWorker->addStartDependency(worker);
worker->addStopDependency(extraWorker);
// Make sure the QML Profiler is stopped before the appman-controller
runner->addStopDependency(extraWorker);
return worker;
});
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
addSupportedRunMode(ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE); addSupportedRunMode(ProjectExplorer::Constants::QML_PREVIEW_RUN_MODE);
addSupportedRunConfig(Constants::RUNANDDEBUGCONFIGURATION_ID); addSupportedRunConfig(Constants::RUNANDDEBUGCONFIGURATION_ID);