diff options
author | hjk <[email protected]> | 2023-11-21 15:32:18 +0100 |
---|---|---|
committer | hjk <[email protected]> | 2023-11-21 16:40:29 +0000 |
commit | 86ef1476cbf10578c6c2cbaa3b5455504d0fe3b1 (patch) | |
tree | 18bf15f65daaace81424d588e0ecf5be8f200963 /src | |
parent | 0a3d71cd364ddf84562cdb00b8a2d2f9d19fcd24 (diff) |
PerfProfiler: Use new setup for RunWorkerFactory
Change-Id: I2792828a2e924191f4f24f666b5a61390048a0ae
Reviewed-by: Jarek Kobus <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/perfprofiler/perfprofilerplugin.cpp | 3 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilerruncontrol.cpp | 15 | ||||
-rw-r--r-- | src/plugins/perfprofiler/perfprofilerruncontrol.h | 6 |
3 files changed, 15 insertions, 9 deletions
diff --git a/src/plugins/perfprofiler/perfprofilerplugin.cpp b/src/plugins/perfprofiler/perfprofilerplugin.cpp index f7ac90eaa9a..1043d5026bd 100644 --- a/src/plugins/perfprofiler/perfprofilerplugin.cpp +++ b/src/plugins/perfprofiler/perfprofilerplugin.cpp @@ -25,7 +25,6 @@ public: RunConfiguration::registerAspect<PerfRunConfigurationAspect>(); } - PerfProfilerRunWorkerFactory profilerWorkerFactory; PerfProfilerTool profilerTool; }; @@ -36,6 +35,8 @@ PerfProfilerPlugin::~PerfProfilerPlugin() void PerfProfilerPlugin::initialize() { + setupPerfProfilerRunWorker(); + d = new PerfProfilerPluginPrivate; #if WITH_TESTS diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp index 1919547383d..64f0edaf6ff 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp @@ -205,10 +205,19 @@ void PerfProfilerRunner::start() // PerfProfilerRunWorkerFactory -PerfProfilerRunWorkerFactory::PerfProfilerRunWorkerFactory() +class PerfProfilerRunWorkerFactory final : public RunWorkerFactory { - setProduct<PerfProfilerRunner>(); - addSupportedRunMode(ProjectExplorer::Constants::PERFPROFILER_RUN_MODE); +public: + PerfProfilerRunWorkerFactory() + { + setProduct<PerfProfilerRunner>(); + addSupportedRunMode(ProjectExplorer::Constants::PERFPROFILER_RUN_MODE); + } +}; + +void setupPerfProfilerRunWorker() +{ + static PerfProfilerRunWorkerFactory thePerfProfilerRunWorkerFactory; } } // PerfProfiler::Internal diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.h b/src/plugins/perfprofiler/perfprofilerruncontrol.h index 4a027900420..9db8655f417 100644 --- a/src/plugins/perfprofiler/perfprofilerruncontrol.h +++ b/src/plugins/perfprofiler/perfprofilerruncontrol.h @@ -23,10 +23,6 @@ private: ProjectExplorer::RunWorker *m_perfRecordWorker = nullptr; }; -class PerfProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory -{ -public: - PerfProfilerRunWorkerFactory(); -}; +void setupPerfProfilerRunWorker(); } // PerfProfiler::Internal |