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 <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2017-10-04 12:00:47 +02:00
parent c330cf0679
commit 0693db3579

View File

@@ -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)