diff options
Diffstat (limited to 'src/plugins/projectexplorer/projectexplorer.cpp')
-rw-r--r-- | src/plugins/projectexplorer/projectexplorer.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 61c3bf50a7..e6c25c84b6 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1980,10 +1980,18 @@ void ProjectExplorerPluginPrivate::buildStateChanged(Project * pro) // NBS TODO implement more than one runner static IRunControlFactory *findRunControlFactory(RunConfiguration *config, Core::Id mode) { - return ExtensionSystem::PluginManager::getObject<IRunControlFactory>( + auto factories = ExtensionSystem::PluginManager::getObjects<IRunControlFactory>( [&config, &mode](IRunControlFactory *factory) { return factory->canRun(config, mode); }); + + if (factories.isEmpty()) + return nullptr; + auto it = std::max_element(factories.begin(), factories.end(), + [](IRunControlFactory *a, IRunControlFactory *b) { + return a->priority() < b->priority(); + }); + return *it; } void ProjectExplorerPluginPrivate::executeRunConfiguration(RunConfiguration *runConfiguration, Core::Id runMode) |