forked from qt-creator/qt-creator
ITargetFactory: Make supportedTargetIds() and canCreate() orthogonal
ITargetFactory::supportedTargetIds should return all targets that this factory can support, regardless of e.g. installed qt versions. Whereas canCreate() should check the availability of e.g. a qt version. This makes supportedTargetIds() have the same meaning as ITargetFactory::supportsTargetId(). Change-Id: I744abb89e441026d6f3f8de21944d780e9b9fa32 Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
This commit is contained in:
@@ -312,11 +312,14 @@ bool ProjectWindow::useTargetPage(ProjectExplorer::Project *project)
|
||||
return false;
|
||||
if (project->targets().size() > 1)
|
||||
return true;
|
||||
QStringList tmp;
|
||||
int count = 0;
|
||||
foreach (ITargetFactory *fac, ExtensionSystem::PluginManager::instance()->getObjects<ITargetFactory>()) {
|
||||
tmp.append(fac->supportedTargetIds(project));
|
||||
if (tmp.size() > 1)
|
||||
return true;
|
||||
foreach (const QString &targetId, fac->supportedTargetIds()) {
|
||||
if (fac->canCreate(project, targetId))
|
||||
++count;
|
||||
if (count > 1)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user