iOS: Use SimpleRunWorkerFactory instead of manual registration

Same result, less code, more fashionable.

Change-Id: I43b0fcc6e5efb5e394b1652c3c9b34871cbe2fee
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2019-03-20 13:58:59 +01:00
parent ed87b74a59
commit 0c6f234d43

View File

@@ -94,6 +94,13 @@ public:
IosDeployStepFactory deployStepFactory;
IosDsymBuildStepFactory dsymBuildStepFactory;
IosDeployConfigurationFactory deployConfigurationFactory;
SimpleRunWorkerFactory<Internal::IosRunSupport, IosRunConfiguration>
runWorkerFactory{ProjectExplorer::Constants::NORMAL_RUN_MODE};
SimpleRunWorkerFactory<Internal::IosDebugSupport, IosRunConfiguration>
debugWorkerFactory{ProjectExplorer::Constants::DEBUG_RUN_MODE};
SimpleRunWorkerFactory<Internal::IosQmlProfilerSupport, IosRunConfiguration>
qmlProfilerWorkerFactory{ProjectExplorer::Constants::QML_PROFILER_RUN_MODE};
};
IosPlugin::~IosPlugin()
@@ -112,17 +119,6 @@ bool IosPlugin::initialize(const QStringList &arguments, QString *errorMessage)
d = new IosPluginPrivate;
auto constraint = [](RunConfiguration *runConfig) {
return qobject_cast<IosRunConfiguration *>(runConfig) != nullptr;
};
RunControl::registerWorker<Internal::IosRunSupport>
(ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint);
RunControl::registerWorker<Internal::IosDebugSupport>
(ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint);
RunControl::registerWorker<Internal::IosQmlProfilerSupport>
(ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint);
return true;
}