diff --git a/src/plugins/projectexplorer/runcontrol.cpp b/src/plugins/projectexplorer/runcontrol.cpp index c7039fd78f0..0afc1a93d34 100644 --- a/src/plugins/projectexplorer/runcontrol.cpp +++ b/src/plugins/projectexplorer/runcontrol.cpp @@ -73,6 +73,9 @@ namespace ProjectExplorer { static QList g_runWorkerFactories; +static QSet g_runModes; +static QSet g_runConfigs; + RunWorkerFactory::RunWorkerFactory(const WorkerCreator &producer, const QList &runModes, const QList &runConfigs, @@ -83,6 +86,12 @@ RunWorkerFactory::RunWorkerFactory(const WorkerCreator &producer, m_supportedDeviceTypes(deviceTypes) { g_runWorkerFactories.append(this); + + // Debugging only. + for (Core::Id runMode : runModes) + g_runModes.insert(runMode); + for (Core::Id runConfig : runConfigs) + g_runConfigs.insert(runConfig); } RunWorkerFactory::~RunWorkerFactory() @@ -119,6 +128,27 @@ bool RunWorkerFactory::canRun(Core::Id runMode, return true; } +void RunWorkerFactory::dumpAll() +{ + const QList devices = + Utils::transform(IDeviceFactory::allDeviceFactories(), &IDeviceFactory::deviceType); + + for (Core::Id runMode : qAsConst(g_runModes)) { + qDebug() << ""; + for (Core::Id device : devices) { + for (Core::Id runConfig : qAsConst(g_runConfigs)) { + const auto check = std::bind(&RunWorkerFactory::canRun, + std::placeholders::_1, + runMode, + device, + runConfig.toString()); + const auto factory = Utils::findOrDefault(g_runWorkerFactories, check); + qDebug() << "MODE:" << runMode << device << runConfig << factory; + } + } + } +} + /*! \class ProjectExplorer::RunControl \brief The RunControl class instances represent one item that is run. diff --git a/src/plugins/projectexplorer/runcontrol.h b/src/plugins/projectexplorer/runcontrol.h index 09abfac3535..1d8ead5fa7e 100644 --- a/src/plugins/projectexplorer/runcontrol.h +++ b/src/plugins/projectexplorer/runcontrol.h @@ -160,6 +160,9 @@ public: return [](RunControl *runControl) { return new Worker(runControl); }; } + // For debugging only. + static void dumpAll(); + private: WorkerCreator m_producer; QList m_supportedRunModes;