Commit 7d45a1a1 authored by Daniel Teske's avatar Daniel Teske
Browse files

IBuildConfigurationFactory: Partial revert of 5a30007e



The find methods should not return a factory with a -1 priority.

Change-Id: I05dab0c48b24b30f88cf40f49c2bc0e24bff46ec
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 110293d4
......@@ -344,23 +344,33 @@ IBuildConfigurationFactory *IBuildConfigurationFactory::find(Kit *k, const QStri
{
QList<IBuildConfigurationFactory *> factories
= ExtensionSystem::PluginManager::instance()->getObjects<IBuildConfigurationFactory>();
return Utils::bestElementOr(factories, 0,
[&k, &projectPath](IBuildConfigurationFactory *a, IBuildConfigurationFactory *b) {
return a->priority(k, projectPath) > b->priority(k, projectPath);
});
IBuildConfigurationFactory *factory = 0;
int priority = -1;
foreach (IBuildConfigurationFactory *i, factories) {
int iPriority = i->priority(k, projectPath);
if (iPriority > priority) {
factory = i;
priority = iPriority;
}
}
return factory;
}
// create
IBuildConfigurationFactory * IBuildConfigurationFactory::find(Target *parent)
{
QList<IBuildConfigurationFactory *> factories
= ExtensionSystem::PluginManager::getObjects<IBuildConfigurationFactory>();
return Utils::bestElementOr(factories, 0,
[&parent](IBuildConfigurationFactory *a, IBuildConfigurationFactory *b) {
return a->priority(parent) > b->priority(parent);
});
= ExtensionSystem::PluginManager::instance()->getObjects<IBuildConfigurationFactory>();
IBuildConfigurationFactory *factory = 0;
int priority = -1;
foreach (IBuildConfigurationFactory *i, factories) {
int iPriority = i->priority(parent);
if (iPriority > priority) {
factory = i;
priority = iPriority;
}
}
return factory;
}
// clone
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment