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

View File

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

View File

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

View File

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

View File

@@ -29,10 +29,9 @@
using namespace Core;
using namespace ProjectExplorer;
namespace QmlProfiler {
namespace Internal {
namespace QmlProfiler::Internal {
static QString QmlServerUrl = "QmlServerUrl";
const QString QmlServerUrl = "QmlServerUrl";
//
// QmlProfilerRunControlPrivate
@@ -237,5 +236,21 @@ LocalQmlProfilerSupport::LocalQmlProfilerSupport(RunControl *runControl, const Q
});
}
} // namespace Internal
} // namespace QmlProfiler
// Factories
// 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>
namespace QmlProfiler {
namespace Internal {
namespace QmlProfiler::Internal {
class QmlProfilerRunner : public ProjectExplorer::RunWorker
{
@@ -51,5 +50,18 @@ public:
const QUrl &serverUrl);
};
} // namespace Internal
} // namespace QmlProfiler
// The bits plugged in in remote setups.
class QmlProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
QmlProfilerRunWorkerFactory();
};
// The full local profiler.
class LocalQmlProfilerRunWorkerFactory final : public ProjectExplorer::RunWorkerFactory
{
public:
LocalQmlProfilerRunWorkerFactory();
};
} // QmlProfiler::Internal