From 311bed936ca8ab907de8b6609f685d95a56b188c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Wed, 22 Feb 2017 11:47:43 +0100 Subject: Fix that last session could reset to default session E.g. when opening and closing Qt Creator without opening a session. The last session may only be updated to the "active" session, if it is not the default-virgin session (which is actually a "no session" value). Change-Id: If47da30d94c20df62d45960224e3137bcc6ba1b8 Reviewed-by: hjk Reviewed-by: Tobias Hunger --- src/plugins/projectexplorer/projectexplorer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index a4aed71e84..2bc865fc84 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -1556,7 +1556,8 @@ void ProjectExplorerPluginPrivate::savePersistentSettings() } QSettings *s = ICore::settings(); - s->setValue(QLatin1String("ProjectExplorer/StartupSession"), SessionManager::activeSession()); + if (!SessionManager::isDefaultVirgin()) + s->setValue(QLatin1String("ProjectExplorer/StartupSession"), SessionManager::activeSession()); s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files")); QStringList fileNames; -- cgit v1.2.1