Commit a4a4f7a4 authored by Daniel Teske's avatar Daniel Teske
Browse files

ProjectExplorer: Fix disabled "Close Project" after closing project

The close project action is special. If there are multiple projects open
we show a menu with individual actions per project. If only one project
is open, we show one the "m_unloadAction". Even with only one project
open, the current project might be null. So explicitly manage enabled
the same way as visible. And also us the displayName of the startup
project, since that is guranteed to be non-null if there's a project

Task-number: QTCREATORBUG-13497
Change-Id: I9150568da162c58ee524c2b954e0b9a816f79d7c
Reviewed-by: default avatarEike Ziller <>
parent 5449e0a7
......@@ -741,7 +741,7 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
// unload action
dd->m_unloadAction = new Utils::ParameterAction(tr("Close Project"), tr("Close Project \"%1\""),
Utils::ParameterAction::EnabledWithParameter, this);
Utils::ParameterAction::AlwaysEnabled, this);
cmd = ActionManager::registerAction(dd->m_unloadAction, Constants::UNLOAD, globalcontext);
......@@ -2148,7 +2148,7 @@ void ProjectExplorerPluginPrivate::updateActions()
QString projectName = project ? project->displayName() : QString();
QString projectNameContextMenu = m_currentProject ? m_currentProject->displayName() : QString();
// Normal actions
......@@ -2198,6 +2198,7 @@ void ProjectExplorerPluginPrivate::updateActions()
// Session actions
m_unloadAction->setVisible(SessionManager::projects().size() <= 1);
m_unloadAction->setEnabled(SessionManager::projects().size() == 1);
ActionContainer *aci =
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment