diff options
author | hjk <hjk@qt.io> | 2019-04-03 14:25:11 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-04-03 16:08:07 +0000 |
commit | 9dd05ec34107cabeb1fcd940fc8d0255ff81c49d (patch) | |
tree | 1014ab688219d1bb57126ef7cee70ac15728c03a /src/plugins/qnx | |
parent | 4ff5157a24c1dce34d1e1c29a957108de7867085 (diff) | |
download | qt-creator-9dd05ec34107cabeb1fcd940fc8d0255ff81c49d.tar.gz |
Qnx: Use SimpleRunWorkerFactory instead of manual registration
Looks like the extra constraint was effectively checking only for the
presence of a QnxRunConfiguration, which are only created for devices of
type Constants::QNX_QNX_OS_TYPE, which happen to be the only one with
with a bool(...dynamicCast<const QnxDevice>()) == true.
The previous runConfig->isEnabled() is unsystematic, not used anywhere
else, and effectively globally handled in PE::canRunStartupProject.
Change-Id: I5bf814fb5316bb38d315179b16ad4a78faff6899
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qnx')
-rw-r--r-- | src/plugins/qnx/qnxplugin.cpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/plugins/qnx/qnxplugin.cpp b/src/plugins/qnx/qnxplugin.cpp index 2e4c170ff7..28965ed132 100644 --- a/src/plugins/qnx/qnxplugin.cpp +++ b/src/plugins/qnx/qnxplugin.cpp @@ -115,6 +115,13 @@ public: QnxRunConfigurationFactory runConfigFactory; QnxSettingsPage settingsPage; QnxToolChainFactory toolChainFactory; + + SimpleRunWorkerFactory<SimpleTargetRunner, QnxRunConfiguration> + runWorkerFactory{ProjectExplorer::Constants::NORMAL_RUN_MODE}; + SimpleRunWorkerFactory<QnxDebugSupport, QnxRunConfiguration> + debugWorkerFactory{ProjectExplorer::Constants::DEBUG_RUN_MODE}; + SimpleRunWorkerFactory<QnxQmlProfilerSupport, QnxRunConfiguration> + qmlProfilerWorkerFactory; }; static QnxPluginPrivate *dd = nullptr; @@ -131,24 +138,6 @@ bool QnxPlugin::initialize(const QStringList &arguments, QString *errorString) dd = new QnxPluginPrivate; - auto constraint = [](RunConfiguration *runConfig) { - if (!runConfig->isEnabled() - || !runConfig->id().name().startsWith(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX)) { - return false; - } - - auto dev = DeviceKitAspect::device(runConfig->target()->kit()) - .dynamicCast<const QnxDevice>(); - return !dev.isNull(); - }; - - RunControl::registerWorker<SimpleTargetRunner> - (ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint); - RunControl::registerWorker<QnxDebugSupport> - (ProjectExplorer::Constants::DEBUG_RUN_MODE, constraint); - RunControl::registerWorker<QnxQmlProfilerSupport> - (ProjectExplorer::Constants::QML_PROFILER_RUN_MODE, constraint); - return true; } |