diff options
Diffstat (limited to 'src/mumble/JSONSerialization.cpp')
-rw-r--r-- | src/mumble/JSONSerialization.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mumble/JSONSerialization.cpp b/src/mumble/JSONSerialization.cpp index 8729e440e..cd24c483f 100644 --- a/src/mumble/JSONSerialization.cpp +++ b/src/mumble/JSONSerialization.cpp @@ -153,7 +153,16 @@ void migrateSettings(nlohmann::json &json, int settingsVersion) { // Perform conversions required to transform the given JSON into the format applicable to be read out by the most // recent standards - (void) json; + // Check if the old ask_on_quit key exists and the new one does not exist within the json file + if (json.contains("ask_on_quit") + && (!json.contains(static_cast< const char * >(SettingsKeys::QUIT_BEHAVIOR_KEY)))) { + if (!json.at("ask_on_quit").get< bool >()) { + json[SettingsKeys::QUIT_BEHAVIOR_KEY] = QuitBehavior::ALWAYS_QUIT; + } else { + json[SettingsKeys::QUIT_BEHAVIOR_KEY] = QuitBehavior::ALWAYS_ASK; + } + } + (void) settingsVersion; } |