ProjectExplorer: Heed RunControlFactory priorities again

This fixes the regression introduced in 5a848aa188 and uses the
feature to resolve the conflict between ClangStaticAnalyzer and Boot2Qt.

Change-Id: I6cdec8261a457c399c11a4b2078a78088d4c56d1
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-07-14 11:22:35 +02:00
parent a7e895166f
commit c8054d9547
3 changed files with 23 additions and 12 deletions

View File

@@ -522,14 +522,24 @@ bool IRunControlFactory::canRun(RunConfiguration *runConfiguration, Core::Id run
RunControl *IRunControlFactory::create(RunConfiguration *runConfiguration, Core::Id runMode, QString *)
{
WorkerFactories candidates;
for (const RunControl::WorkerFactory &factory : theWorkerFactories()) {
if (factory.canRun(runConfiguration, runMode)) {
auto runControl = new RunControl(runConfiguration, runMode);
factory.producer(runControl);
return runControl;
}
};
return nullptr;
if (factory.canRun(runConfiguration, runMode))
candidates.push_back(factory);
}
if (candidates.empty())
return nullptr;
RunControl::WorkerFactory bestFactory = *candidates.begin();
for (const RunControl::WorkerFactory &factory : candidates) {
if (factory.priority > bestFactory.priority)
bestFactory = factory;
}
auto runControl = new RunControl(runConfiguration, runMode);
bestFactory.producer(runControl);
return runControl;
}
/*!