From f9c221eb54ca3174c57f736b7afd5914147ab2a2 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 7 Aug 2019 18:05:15 +0200 Subject: ProjectExplorer: Re-work setup runworker factories This combines two of the previous three paths to create run workers, and refers to RunConfigurations by id, not by type where possible to decrease coupling between the classes. Only allow "type of run configuration" and "type of device" as the only possible kind of restriction and require a uniform RunWorker constructor signature. Adapt user code to fit that pattern. Change-Id: I5a6d49c9a144785fd0235d7586f244b56f67b366 Reviewed-by: Christian Stenger --- src/plugins/perfprofiler/perfprofilerplugin.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/plugins/perfprofiler') diff --git a/src/plugins/perfprofiler/perfprofilerplugin.cpp b/src/plugins/perfprofiler/perfprofilerplugin.cpp index 26f2272204d..d6f791b553e 100644 --- a/src/plugins/perfprofiler/perfprofilerplugin.cpp +++ b/src/plugins/perfprofiler/perfprofilerplugin.cpp @@ -69,12 +69,13 @@ public: RunControl::registerWorkerCreator(ProjectExplorer::Constants::PERFPROFILER_RUN_MODE, [](RunControl *runControl){ return new PerfProfilerRunner(runControl); }); - - auto constraint = [](RunConfiguration *) { return true; }; - RunControl::registerWorker - (ProjectExplorer::Constants::PERFPROFILER_RUN_MODE, constraint); } + RunWorkerFactory profilerWorkerFactory{ + RunWorkerFactory::make(), + {ProjectExplorer::Constants::PERFPROFILER_RUN_MODE} + }; + PerfOptionsPage optionsPage; PerfProfilerTool profilerTool; }; -- cgit v1.2.3