From 9bfe18393fa699ae7a7203c82ff6efca783f8fce Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 10 Jul 2017 11:45:03 +0200 Subject: [PATCH] Make sure the preferences file doesn't always get upgraded When the setting is equal to the default the setting_version won't get written to the preferences file. In that case the version upgrade system assumes that the setting_version was 0 or 1 and upgrades it. This makes sure that the setting is never equal to the default so that it always gets written. Found while working on CURA-4024. --- cura/CuraApplication.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 048973c5c4..418b3c0e9b 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -268,7 +268,8 @@ class CuraApplication(QtApplication): ContainerRegistry.getInstance().load() # set the setting version for Preferences - Preferences.getInstance().addPreference("metadata/setting_version", CuraApplication.SettingVersion) + Preferences.getInstance().addPreference("metadata/setting_version", 0) + Preferences.getInstance().setValue("metadata/setting_version", self.SettingVersion) #Don't make it equal to the default so that the setting version always gets written to the file. Preferences.getInstance().addPreference("cura/active_mode", "simple")