aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorFelix (xq) Queißner <git@mq32.de>2021-03-15 12:57:36 +0100
committerFelix Queißner <felix@ib-queissner.de>2021-03-17 09:49:58 +0100
commitf60dac9d7ebb5b989aad67d67d5ab3ccef7d278c (patch)
treee2f74ba184d14ee6302d89ce4d61c1972e733360 /src/main.cpp
parent0d1fd257093c58bfb606aaac530aed3b0877f7fd (diff)
downloadkristall-f60dac9d7ebb5b989aad67d67d5ab3ccef7d278c.tar.gz
Adds option to have old or new session behaviour. Closes #187
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index cd8e5ef..c881ee8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -682,13 +682,12 @@ int main(int argc, char *argv[])
// Stores the first window from the restored session (if any)
MainWindow * root_window = nullptr;
- if(session_store != nullptr)
+ if((session_store != nullptr) and (kristall::globals().options.session_restore_behaviour == GenericSettings::RestoreLastSession))
{
auto & settings = *session_store;
int window_count = settings.beginReadArray("windows");
-
for(int index = 0; index < window_count; index += 1)
{
settings.setArrayIndex(index);
@@ -822,6 +821,8 @@ void GenericSettings::load(QSettings &settings)
cache_threshold = settings.value("cache_threshold", 125).toInt();
cache_life = settings.value("cache_life", 15).toInt();
cache_unlimited_life = settings.value("cache_unlimited_life", true).toBool();
+
+ session_restore_behaviour = SessionRestoreBehaviour(settings.value("session_restore_behaviour", int(session_restore_behaviour)).toInt());
}
void GenericSettings::save(QSettings &settings) const
@@ -886,6 +887,8 @@ void GenericSettings::save(QSettings &settings) const
// with emoji support, they get it out of the box.
settings.setValue("emojis_enabled", emojis_enabled);
}
+
+ settings.setValue("session_restore_behaviour", int(session_restore_behaviour));
}
void kristall::applySettings()