forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user