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:
Daniel Teske
2012-02-17 11:55:11 +01:00
parent 6572cfa5bb
commit 72d466200a
23 changed files with 61 additions and 78 deletions

View File

@@ -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;
}