From d995b650abfd4bbd8bde00deb75fde93b55c6a7c Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 20 Jan 2023 15:36:17 +0100 Subject: [PATCH] ProjectExplorer: Remove now unused RunWorkerFactory setup functions Change-Id: Ibac853d2ecaf8e22a64e17d54a1e82121257c655 Reviewed-by: Reviewed-by: Christian Stenger --- src/plugins/projectexplorer/runcontrol.cpp | 22 ++++------------------ src/plugins/projectexplorer/runcontrol.h | 11 ----------- 2 files changed, 4 insertions(+), 29 deletions(-) diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index 490e5668de6..8bbdf433a13 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -74,24 +74,6 @@ RunWorkerFactory::RunWorkerFactory() g_runWorkerFactories.append(this); } -RunWorkerFactory::RunWorkerFactory(const WorkerCreator &producer, - const QList &runModes, - const QList &runConfigs, - const QList &deviceTypes) - : m_producer(producer), - m_supportedRunModes(runModes), - m_supportedRunConfigurations(runConfigs), - m_supportedDeviceTypes(deviceTypes) -{ - g_runWorkerFactories.append(this); - - // Debugging only. - for (Utils::Id runMode : runModes) - g_runModes.insert(runMode); - for (Utils::Id runConfig : runConfigs) - g_runConfigs.insert(runConfig); -} - RunWorkerFactory::~RunWorkerFactory() { g_runWorkerFactories.removeOne(this); @@ -104,16 +86,20 @@ void RunWorkerFactory::setProducer(const WorkerCreator &producer) void RunWorkerFactory::setSupportedRunConfigs(const QList &runConfigs) { + for (Id runConfig : runConfigs) + g_runConfigs.insert(runConfig); // Debugging only. m_supportedRunConfigurations = runConfigs; } void RunWorkerFactory::addSupportedRunMode(Utils::Id runMode) { + g_runModes.insert(runMode); // Debugging only. m_supportedRunModes.append(runMode); } void RunWorkerFactory::addSupportedRunConfig(Utils::Id runConfig) { + g_runConfigs.insert(runConfig); // Debugging only. m_supportedRunConfigurations.append(runConfig); } diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index fe9a06b9c42..df849eca3a8 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -114,22 +114,11 @@ public: using WorkerCreator = std::function; RunWorkerFactory(); - RunWorkerFactory(const WorkerCreator &producer, - const QList &runModes, - const QList &runConfigs = {}, - const QList &deviceTypes = {}); - ~RunWorkerFactory(); bool canRun(Utils::Id runMode, Utils::Id deviceType, const QString &runConfigId) const; WorkerCreator producer() const { return m_producer; } - template - static WorkerCreator make() - { - return [](RunControl *runControl) { return new Worker(runControl); }; - } - // For debugging only. static void dumpAll();