forked from qt-creator/qt-creator
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user