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.
This commit is contained in:
Ghostkeeper 2017-07-10 11:45:03 +02:00
parent f0d327c0d0
commit 9bfe18393f
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -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")