From 0693db35795da7a1a8e777c5ce4a0df97ce34382 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 4 Oct 2017 12:00:47 +0200 Subject: [PATCH] SessionManager: set startup project on addProject If there is no startup project when we add a new project the new project should become the startup project, as a situation where there are projects, but no startup project is invalid. removeProject also checks for the startupProject and adjusts it if necessary. Change-Id: I5f12add832db82af553fc1e393e32185eb322866 Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/session.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp index 6d7a4ef7641..f96414e7818 100644 --- a/src/plugins/projectexplorer/session.cpp +++ b/src/plugins/projectexplorer/session.cpp @@ -403,6 +403,9 @@ void SessionManager::addProject(Project *pro) configureEditors(pro); connect(pro, &Project::fileListChanged, [pro](){ configureEditors(pro); }); connect(pro, &Project::displayNameChanged, pro, updateFolderNavigation); + + if (!startupProject()) + setStartupProject(pro); } void SessionManager::removeProject(Project *project)