From 1c38aa287aaf625d94059962f7aa581618daf6bb Mon Sep 17 00:00:00 2001 From: Daniel Teske Date: Wed, 16 Sep 2015 16:33:33 +0200 Subject: [PATCH] Simplify logic for showing UnconfiguredTargetPanel/TargetPanel This doesn't change when the those panes are shown. Change-Id: Ie5a2d27321e5268f59775892198999a8414a0adb Reviewed-by: Tobias Hunger --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 2 +- src/plugins/projectexplorer/projectexplorer.cpp | 5 ++--- src/plugins/qmakeprojectmanager/qmakeproject.cpp | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index 343b9066515..fe580a3de26 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -389,7 +389,7 @@ bool CMakeProject::needsConfiguration() const bool CMakeProject::requiresTargetPanel() const { - return false; + return !targets().isEmpty(); } bool CMakeProject::isProjectFile(const FileName &fileName) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 57142073db5..a02a5bcf95b 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -605,7 +605,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er unconfiguredProjectPanel->setPriority(-10); unconfiguredProjectPanel->setDisplayName(tr("Configure Project")); unconfiguredProjectPanel->setSupportsFunction([](Project *project){ - return project->targets().isEmpty() && !project->requiresTargetPanel(); + return project->needsConfiguration(); }); icon = QIcon(QLatin1String(":/projectexplorer/images/unconfigured.png")); unconfiguredProjectPanel->setSimpleCreateWidgetFunction(icon); @@ -616,8 +616,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er displayName = QCoreApplication::translate("TargetSettingsPanelFactory", "Build & Run"); targetSettingsPanelFactory->setDisplayName(displayName); targetSettingsPanelFactory->setSupportsFunction([](Project *project) { - return !project->targets().isEmpty() - || project->requiresTargetPanel(); + return project->requiresTargetPanel(); }); targetSettingsPanelFactory->setCreateWidgetFunction([](Project *project) { return new TargetSettingsPanelWidget(project); diff --git a/src/plugins/qmakeprojectmanager/qmakeproject.cpp b/src/plugins/qmakeprojectmanager/qmakeproject.cpp index e8bd8d7fc3c..561d5535db7 100644 --- a/src/plugins/qmakeprojectmanager/qmakeproject.cpp +++ b/src/plugins/qmakeprojectmanager/qmakeproject.cpp @@ -1363,7 +1363,7 @@ void QmakeProject::configureAsExampleProject(const QStringList &platforms) bool QmakeProject::requiresTargetPanel() const { - return false; + return !targets().isEmpty(); } // All the Qmake run configurations should share code.