Simplfy code dealing with the projects page

Distinguish between pages that are target specific and project specific.
Do the magic hierarchy reduction if only one target is supported just in
the projectwindow. Treat the targets page specially.

Reviewed-By: hunger
This commit is contained in:
dt
2010-03-25 16:16:38 +01:00
parent 184fd353d2
commit 70dc75990f
14 changed files with 91 additions and 208 deletions

View File

@@ -65,23 +65,11 @@ QString BuildSettingsPanelFactory::displayName() const
return QCoreApplication::translate("BuildSettingsPanelFactory", "Build Settings");
}
bool BuildSettingsPanelFactory::supports(Project *project)
{
return project->targets().count() == 1;
}
bool BuildSettingsPanelFactory::supports(Target *target)
{
return target->buildConfigurationFactory();
}
IPropertiesPanel *BuildSettingsPanelFactory::createPanel(Project *project)
{
Q_ASSERT(supports(project));
return new BuildSettingsPanel(project->activeTarget());
}
IPropertiesPanel *BuildSettingsPanelFactory::createPanel(Target *target)
{
return new BuildSettingsPanel(target);