QmlProfiler: Use new setup for runworker

Change-Id: I3be81b59a0f9426909cd6dc3df2e0bacc8aea1be
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2023-11-21 18:09:22 +01:00
parent 00e3c59981
commit da0f308bea
3 changed files with 26 additions and 26 deletions

View File

@@ -56,17 +56,14 @@ class QmlProfilerPluginPrivate
{ {
public: public:
QmlProfilerTool m_profilerTool; QmlProfilerTool m_profilerTool;
// The full local profiler.
LocalQmlProfilerRunWorkerFactory localQmlProfilerRunWorkerFactory;
// The bits plugged in in remote setups.
QmlProfilerRunWorkerFactory qmlProfilerRunWorkerFactory;
}; };
bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString) bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString)
{ {
Q_UNUSED(arguments) Q_UNUSED(arguments)
setupQmlProfilerRunning();
#ifdef WITH_TESTS #ifdef WITH_TESTS
addTest<DebugMessagesModelTest>(); addTest<DebugMessagesModelTest>();
addTest<FlameGraphModelTest>(); addTest<FlameGraphModelTest>();

View File

@@ -239,18 +239,33 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
// Factories // Factories
// The bits plugged in in remote setups. // The bits plugged in in remote setups.
QmlProfilerRunWorkerFactory::QmlProfilerRunWorkerFactory() class QmlProfilerRunWorkerFactory final : public RunWorkerFactory
{ {
setProduct<QmlProfilerRunner>(); public:
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUNNER); QmlProfilerRunWorkerFactory()
} {
setProduct<QmlProfilerRunner>();
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUNNER);
}
};
// The full local profiler. // The full local profiler.
LocalQmlProfilerRunWorkerFactory::LocalQmlProfilerRunWorkerFactory() class LocalQmlProfilerRunWorkerFactory final : public RunWorkerFactory
{ {
setProduct<LocalQmlProfilerSupport>(); public:
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE); LocalQmlProfilerRunWorkerFactory()
addSupportedDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE); {
setProduct<LocalQmlProfilerSupport>();
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
addSupportedDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE);
}
};
void setupQmlProfilerRunning()
{
static QmlProfilerRunWorkerFactory theQmlProfilerRunWorkerFactory;
static LocalQmlProfilerRunWorkerFactory theLocalQmlProfilerRunWorkerFactory;
} }
} // QmlProfiler::Internal } // QmlProfiler::Internal

View File

@@ -50,18 +50,6 @@ public:
const QUrl &serverUrl); const QUrl &serverUrl);
}; };
// The bits plugged in in remote setups. void setupQmlProfilerRunning();
class QmlProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
QmlProfilerRunWorkerFactory();
};
// The full local profiler.
class LocalQmlProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
LocalQmlProfilerRunWorkerFactory();
};
} // QmlProfiler::Internal } // QmlProfiler::Internal