Fix version upgrade for 2.5 to 2.6

CURA-3975

- Preferences version is not set correctly
- The upgrade script should use a standalone version string because the
  CuraApplication.SettingVersion can change
This commit is contained in:
Lipu Fei 2017-07-06 12:06:02 +02:00
parent ead94a8456
commit 4e3ff1b770

View file

@ -62,8 +62,8 @@ class VersionUpgrade25to26(VersionUpgrade):
parser["general"]["visible_settings"] = ";".join(new_visible_settings)
#Change the version number in the file.
if parser.has_section("general"): #It better have!
parser["general"]["version"] = "5"
parser.set("general", "version", "4")
parser.set("general", "setting_version", "1")
#Re-serialise the file.
output = io.StringIO()
@ -91,11 +91,9 @@ class VersionUpgrade25to26(VersionUpgrade):
if not parser.has_section(each_section):
parser.add_section(each_section)
# Change the version number in the file.
parser["metadata"]["setting_version"] = str(CuraApplication.SettingVersion)
# Update version
# Update version numbers
parser["general"]["version"] = "2"
parser["metadata"]["setting_version"] = "1"
#Re-serialise the file.
output = io.StringIO()