summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/projectexplorer/projectexplorer.cpp6
-rw-r--r--src/plugins/projectexplorer/projectexplorerconstants.h2
-rw-r--r--src/plugins/projectexplorer/session.cpp16
3 files changed, 12 insertions, 12 deletions
diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp
index df77b48f8b..9b9a025255 100644
--- a/src/plugins/projectexplorer/projectexplorer.cpp
+++ b/src/plugins/projectexplorer/projectexplorer.cpp
@@ -2256,12 +2256,6 @@ void ProjectExplorerPluginPrivate::savePersistentSettings()
}
QtcSettings *s = ICore::settings();
- if (SessionManager::isDefaultVirgin()) {
- s->remove(Constants::STARTUPSESSION_KEY);
- } else {
- s->setValue(Constants::STARTUPSESSION_KEY, SessionManager::activeSession());
- s->setValue(Constants::LASTSESSION_KEY, SessionManager::activeSession());
- }
s->remove(QLatin1String("ProjectExplorer/RecentProjects/Files"));
QStringList fileNames;
diff --git a/src/plugins/projectexplorer/projectexplorerconstants.h b/src/plugins/projectexplorer/projectexplorerconstants.h
index 005981e697..75054120a8 100644
--- a/src/plugins/projectexplorer/projectexplorerconstants.h
+++ b/src/plugins/projectexplorer/projectexplorerconstants.h
@@ -206,8 +206,6 @@ const char FILEOVERLAY_UNKNOWN[]=":/projectexplorer/images/fileoverlay_unknown.p
// Settings
const char ADD_FILES_DIALOG_FILTER_HISTORY_KEY[] = "ProjectExplorer.AddFilesFilterKey";
const char PROJECT_ROOT_PATH_KEY[] = "ProjectExplorer.Project.RootPath";
-const char STARTUPSESSION_KEY[] = "ProjectExplorer/SessionToRestore";
-const char LASTSESSION_KEY[] = "ProjectExplorer/StartupSession";
const char SETTINGS_MENU_HIDE_BUILD[] = "Menu/HideBuild";
const char SETTINGS_MENU_HIDE_DEBUG[] = "Menu/HideDebug";
const char SETTINGS_MENU_HIDE_ANALYZE[] = "Menu/HideAnalyze";
diff --git a/src/plugins/projectexplorer/session.cpp b/src/plugins/projectexplorer/session.cpp
index 427cb8e4ca..8de2a10ba2 100644
--- a/src/plugins/projectexplorer/session.cpp
+++ b/src/plugins/projectexplorer/session.cpp
@@ -5,7 +5,6 @@
#include "session_p.h"
-#include "projectexplorerconstants.h"
#include "projectexplorertr.h"
#include "projectmanager.h"
@@ -37,6 +36,8 @@ namespace ProjectExplorer {
const char DEFAULT_SESSION[] = "default";
const char LAST_ACTIVE_TIMES_KEY[] = "LastActiveTimes";
+const char STARTUPSESSION_KEY[] = "ProjectExplorer/SessionToRestore";
+const char LASTSESSION_KEY[] = "ProjectExplorer/StartupSession";
/*!
\class ProjectExplorer::SessionManager
@@ -61,10 +62,17 @@ SessionManager::SessionManager()
this, &SessionManager::saveActiveMode);
connect(ICore::instance(), &ICore::saveSettingsRequested, this, [] {
+ QtcSettings *s = ICore::settings();
QVariantMap times;
for (auto it = sb_d->m_lastActiveTimes.cbegin(); it != sb_d->m_lastActiveTimes.cend(); ++it)
times.insert(it.key(), it.value());
- ICore::settings()->setValue(LAST_ACTIVE_TIMES_KEY, times);
+ s->setValue(LAST_ACTIVE_TIMES_KEY, times);
+ if (SessionManager::isDefaultVirgin()) {
+ s->remove(STARTUPSESSION_KEY);
+ } else {
+ s->setValue(STARTUPSESSION_KEY, SessionManager::activeSession());
+ s->setValue(LASTSESSION_KEY, SessionManager::activeSession());
+ }
});
connect(EditorManager::instance(), &EditorManager::editorOpened,
@@ -266,7 +274,7 @@ void SessionManagerPrivate::restoreEditors(const PersistentSettingsReader &reade
*/
QString SessionManager::lastSession()
{
- return ICore::settings()->value(Constants::LASTSESSION_KEY).toString();
+ return ICore::settings()->value(LASTSESSION_KEY).toString();
}
/*!
@@ -274,7 +282,7 @@ QString SessionManager::lastSession()
*/
QString SessionManager::startupSession()
{
- return ICore::settings()->value(Constants::STARTUPSESSION_KEY).toString();
+ return ICore::settings()->value(STARTUPSESSION_KEY).toString();
}
void SessionManager::markSessionFileDirty()