Commit 8b928191 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

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: default avatarFriedemann Kleint <>
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <>
parent 87faa62f
......@@ -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);
......@@ -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,
Markdown is supported
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