QmlProfiler: use dedicated classes to create run workers

Change-Id: I70d6b778ce6e4892260d4c826b708eadce6b4017
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-01-06 15:32:39 +01:00
parent 263c5e6b7c
commit ea41beb90a
6 changed files with 46 additions and 38 deletions

View File

@@ -51,8 +51,7 @@
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace QmlProfiler { namespace QmlProfiler::Internal {
namespace Internal {
Q_GLOBAL_STATIC(QmlProfilerSettings, qmlProfilerGlobalSettings) Q_GLOBAL_STATIC(QmlProfilerSettings, qmlProfilerGlobalSettings)
@@ -64,20 +63,9 @@ public:
QmlProfilerActions m_actions; QmlProfilerActions m_actions;
// The full local profiler. // The full local profiler.
RunWorkerFactory localQmlProfilerFactory { LocalQmlProfilerRunWorkerFactory localQmlProfilerRunWorkerFactory;
RunWorkerFactory::make<LocalQmlProfilerSupport>(),
{ProjectExplorer::Constants::QML_PROFILER_RUN_MODE},
{},
{ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE}
};
// The bits plugged in in remote setups. // The bits plugged in in remote setups.
RunWorkerFactory qmlProfilerWorkerFactory { QmlProfilerRunWorkerFactory qmlProfilerRunWorkerFactory;
RunWorkerFactory::make<QmlProfilerRunner>(),
{ProjectExplorer::Constants::QML_PROFILER_RUNNER},
{},
{}
};
}; };
bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString) bool QmlProfilerPlugin::initialize(const QStringList &arguments, QString *errorString)
@@ -140,5 +128,4 @@ QVector<QObject *> QmlProfiler::Internal::QmlProfilerPlugin::createTestObjects()
return tests; return tests;
} }
} // namespace Internal } // QmlProfiler::Internal
} // namespace QmlProfiler

View File

@@ -5,8 +5,7 @@
#include <extensionsystem/iplugin.h> #include <extensionsystem/iplugin.h>
namespace QmlProfiler { namespace QmlProfiler::Internal {
namespace Internal {
class QmlProfilerSettings; class QmlProfilerSettings;
@@ -27,5 +26,4 @@ private:
class QmlProfilerPluginPrivate *d = nullptr; class QmlProfilerPluginPrivate *d = nullptr;
}; };
} // namespace Internal } // QmlProfiler::Internal
} // namespace QmlProfiler

View File

@@ -9,8 +9,7 @@
#include <debugger/analyzer/analyzerrunconfigwidget.h> #include <debugger/analyzer/analyzerrunconfigwidget.h>
namespace QmlProfiler { namespace QmlProfiler::Internal {
namespace Internal {
QmlProfilerRunConfigurationAspect::QmlProfilerRunConfigurationAspect(ProjectExplorer::Target *) QmlProfilerRunConfigurationAspect::QmlProfilerRunConfigurationAspect(ProjectExplorer::Target *)
{ {
@@ -23,5 +22,4 @@ QmlProfilerRunConfigurationAspect::QmlProfilerRunConfigurationAspect(ProjectExpl
setConfigWidgetCreator([this] { return new Debugger::AnalyzerRunConfigWidget(this); }); setConfigWidgetCreator([this] { return new Debugger::AnalyzerRunConfigWidget(this); });
} }
} // Internal } // QmlProfiler::Internal
} // QmlProfiler

View File

@@ -5,8 +5,7 @@
#include <projectexplorer/runconfiguration.h> #include <projectexplorer/runconfiguration.h>
namespace QmlProfiler { namespace QmlProfiler::Internal {
namespace Internal {
class QmlProfilerRunConfigurationAspect : public ProjectExplorer::GlobalOrProjectAspect class QmlProfilerRunConfigurationAspect : public ProjectExplorer::GlobalOrProjectAspect
{ {
@@ -14,5 +13,4 @@ public:
QmlProfilerRunConfigurationAspect(ProjectExplorer::Target *); QmlProfilerRunConfigurationAspect(ProjectExplorer::Target *);
}; };
} // Internal } // QmlProfiler::Internal
} // QmlProfiler

View File

@@ -29,10 +29,9 @@
using namespace Core; using namespace Core;
using namespace ProjectExplorer; using namespace ProjectExplorer;
namespace QmlProfiler { namespace QmlProfiler::Internal {
namespace Internal {
static QString QmlServerUrl = "QmlServerUrl"; const QString QmlServerUrl = "QmlServerUrl";
// //
// QmlProfilerRunControlPrivate // QmlProfilerRunControlPrivate
@@ -237,5 +236,21 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
}); });
} }
} // namespace Internal // Factories
} // namespace QmlProfiler
// The bits plugged in in remote setups.
QmlProfilerRunWorkerFactory::QmlProfilerRunWorkerFactory()
{
setProduct<QmlProfilerRunner>();
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUNNER);
}
// The full local profiler.
LocalQmlProfilerRunWorkerFactory::LocalQmlProfilerRunWorkerFactory()
{
setProduct<LocalQmlProfilerSupport>();
addSupportedRunMode(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE);
addSupportedDeviceType(ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE);
}
} // QmlProfiler::Internal

View File

@@ -12,8 +12,7 @@
#include <qmldebug/qmloutputparser.h> #include <qmldebug/qmloutputparser.h>
namespace QmlProfiler { namespace QmlProfiler::Internal {
namespace Internal {
class QmlProfilerRunner : public ProjectExplorer::RunWorker class QmlProfilerRunner : public ProjectExplorer::RunWorker
{ {
@@ -51,5 +50,18 @@ public:
const QUrl &serverUrl); const QUrl &serverUrl);
}; };
} // namespace Internal // The bits plugged in in remote setups.
} // namespace QmlProfiler class QmlProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
QmlProfilerRunWorkerFactory();
};
// The full local profiler.
class LocalQmlProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
LocalQmlProfilerRunWorkerFactory();
};
} // QmlProfiler::Internal