From 8b928191bca2ad8a254e4f6ddd865ca705a0bddd Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Mon, 12 Jan 2015 14:07:09 +0100 Subject: [PATCH] VcsBase: Make Vcs Action active again when opening a project Make Vcs actions active again when a project is opened but no document is open. Task-number: QTCREATORBUG-13609 Change-Id: I3d5accc3dc65412b1af5fc8c6a2baa9ac97c6e25 Reviewed-by: Friedemann Kleint Reviewed-by: Orgad Shaneh --- src/plugins/vcsbase/vcsbaseplugin.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/vcsbase/vcsbaseplugin.cpp b/src/plugins/vcsbase/vcsbaseplugin.cpp index d17ee8e210a..c2e527d42c9 100644 --- a/src/plugins/vcsbase/vcsbaseplugin.cpp +++ b/src/plugins/vcsbase/vcsbaseplugin.cpp @@ -220,6 +220,9 @@ StateListener::StateListener(QObject *parent) : QObject(parent) connect(ProjectTree::instance(), &ProjectTree::currentProjectChanged, this, &StateListener::slotStateChanged); + connect(SessionManager::instance(), &SessionManager::startupProjectChanged, + this, &StateListener::slotStateChanged); + EditorManager::setWindowTitleVcsTopicHandler(&StateListener::windowTitleVcsTopic); } @@ -308,7 +311,10 @@ void StateListener::slotStateChanged() } // Check for project, find the control IVersionControl *projectControl = 0; - if (const Project *currentProject = ProjectTree::currentProject()) { + Project *currentProject = ProjectTree::currentProject(); + if (!currentProject) + currentProject = SessionManager::startupProject(); + if (currentProject) { state.currentProjectPath = currentProject->projectDirectory().toString(); state.currentProjectName = currentProject->displayName(); projectControl = VcsManager::findVersionControlForDirectory(state.currentProjectPath,