forked from qt-creator/qt-creator
Rewrite ::getObjects usage to use predicate version
This makes the code easier to read and shorter. Change-Id: I6d582bd9861aa0208565301f61f098e9313b6c89 Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -42,13 +42,10 @@ QmakeRunConfigurationFactory *QmakeRunConfigurationFactory::find(ProjectExplorer
|
||||
if (!t)
|
||||
return 0;
|
||||
|
||||
QList<QmakeRunConfigurationFactory *> factories
|
||||
= ExtensionSystem::PluginManager::getObjects<QmakeRunConfigurationFactory>();
|
||||
foreach (QmakeRunConfigurationFactory *factory, factories) {
|
||||
if (factory->canHandle(t))
|
||||
return factory;
|
||||
}
|
||||
return 0;
|
||||
return ExtensionSystem::PluginManager::getObject<QmakeRunConfigurationFactory>(
|
||||
[&t](QmakeRunConfigurationFactory *factory) {
|
||||
return factory->canHandle(t);
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace QmakeProjectManager
|
||||
|
||||
Reference in New Issue
Block a user