summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2023-01-05 09:17:19 +0100
committerhjk <hjk@qt.io>2023-01-06 07:16:07 +0000
commit2f6ac9d7971c4986987dd8b84ab9bb83478ea107 (patch)
tree88e4654048b9bf8de2746a905a68ae638589c4fb /src
parentdc6790767927c05332817f64fae1371561fe06cf (diff)
downloadqt-creator-2f6ac9d7971c4986987dd8b84ab9bb83478ea107.tar.gz
PerfProfiler: Use named classes for run worker factories
Change-Id: Ib91f307c69bd2b85626aedf958799417cdd354ee Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/perfprofiler/perfprofilerplugin.cpp12
-rw-r--r--src/plugins/perfprofiler/perfprofilerplugin.h6
-rw-r--r--src/plugins/perfprofiler/perfprofilerruncontrol.cpp17
-rw-r--r--src/plugins/perfprofiler/perfprofilerruncontrol.h12
4 files changed, 26 insertions, 21 deletions
diff --git a/src/plugins/perfprofiler/perfprofilerplugin.cpp b/src/plugins/perfprofiler/perfprofilerplugin.cpp
index 2125b6e6ec..3d236d6653 100644
--- a/src/plugins/perfprofiler/perfprofilerplugin.cpp
+++ b/src/plugins/perfprofiler/perfprofilerplugin.cpp
@@ -33,8 +33,7 @@
using namespace ProjectExplorer;
-namespace PerfProfiler {
-namespace Internal {
+namespace PerfProfiler::Internal {
Q_GLOBAL_STATIC(PerfSettings, perfGlobalSettings)
@@ -46,11 +45,7 @@ public:
RunConfiguration::registerAspect<PerfRunConfigurationAspect>();
}
- RunWorkerFactory profilerWorkerFactory{
- RunWorkerFactory::make<PerfProfilerRunner>(),
- {ProjectExplorer::Constants::PERFPROFILER_RUN_MODE}
- };
-
+ PerfProfilerRunWorkerFactory profilerWorkerFactory;
PerfOptionsPage optionsPage{perfGlobalSettings()};
PerfProfilerTool profilerTool;
};
@@ -84,5 +79,4 @@ QVector<QObject *> PerfProfilerPlugin::createTestObjects() const
return tests;
}
-} // namespace Internal
-} // namespace PerfProfiler
+} // PerfProfiler::Internal
diff --git a/src/plugins/perfprofiler/perfprofilerplugin.h b/src/plugins/perfprofiler/perfprofilerplugin.h
index 62fac15807..35f8899a10 100644
--- a/src/plugins/perfprofiler/perfprofilerplugin.h
+++ b/src/plugins/perfprofiler/perfprofilerplugin.h
@@ -7,8 +7,7 @@
#include <extensionsystem/iplugin.h>
-namespace PerfProfiler {
-namespace Internal {
+namespace PerfProfiler::Internal {
class PerfProfilerPlugin : public ExtensionSystem::IPlugin
{
@@ -26,5 +25,4 @@ public:
class PerfProfilerPluginPrivate *d = nullptr;
};
-} // namespace Internal
-} // namespace PerfProfiler
+} // PerfProfiler::Internal
diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp
index b558aaa8ba..cb1e3b1966 100644
--- a/src/plugins/perfprofiler/perfprofilerruncontrol.cpp
+++ b/src/plugins/perfprofiler/perfprofilerruncontrol.cpp
@@ -10,9 +10,12 @@
#include <coreplugin/icore.h>
#include <coreplugin/messagemanager.h>
+
#include <projectexplorer/devicesupport/idevice.h>
#include <projectexplorer/kitinformation.h>
+#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
+
#include <utils/qtcprocess.h>
#include <QAction>
@@ -22,8 +25,7 @@
using namespace ProjectExplorer;
using namespace Utils;
-namespace PerfProfiler {
-namespace Internal {
+namespace PerfProfiler::Internal {
class PerfParserWorker : public RunWorker
{
@@ -204,7 +206,14 @@ void PerfProfilerRunner::start()
reportStarted();
}
-} // namespace Internal
-} // namespace PerfProfiler
+// PerfProfilerRunWorkerFactory
+
+PerfProfilerRunWorkerFactory::PerfProfilerRunWorkerFactory()
+{
+ setProduct<PerfProfilerRunner>();
+ addSupportedRunMode(ProjectExplorer::Constants::PERFPROFILER_RUN_MODE);
+}
+
+} // PerfProfiler::Internal
#include "perfprofilerruncontrol.moc"
diff --git a/src/plugins/perfprofiler/perfprofilerruncontrol.h b/src/plugins/perfprofiler/perfprofilerruncontrol.h
index 2fe1c4abbc..dfadff2ff0 100644
--- a/src/plugins/perfprofiler/perfprofilerruncontrol.h
+++ b/src/plugins/perfprofiler/perfprofilerruncontrol.h
@@ -5,8 +5,7 @@
#include <projectexplorer/runcontrol.h>
-namespace PerfProfiler {
-namespace Internal {
+namespace PerfProfiler::Internal {
class PerfParserWorker;
class PerfRecordWorker;
@@ -24,5 +23,10 @@ private:
ProjectExplorer::RunWorker *m_perfRecordWorker = nullptr;
};
-} // namespace Internal
-} // namespace PerfProfiler
+class PerfProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
+{
+public:
+ PerfProfilerRunWorkerFactory();
+};
+
+} // PerfProfiler::Internal