mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 02:37:49 -06:00
Fix upgrade of preference if visible settings was not modified
Oops. Small oversight. This could lead to the preferences file being erased completely. Found during work on Sentry issue CURA-NH.
This commit is contained in:
parent
abffb6c26c
commit
dfa021ab20
1 changed files with 6 additions and 5 deletions
|
@ -29,11 +29,12 @@ class VersionUpgrade45to46(VersionUpgrade):
|
||||||
parser["metadata"]["setting_version"] = "12"
|
parser["metadata"]["setting_version"] = "12"
|
||||||
|
|
||||||
# Remove deleted settings from the visible settings list.
|
# Remove deleted settings from the visible settings list.
|
||||||
visible_settings = set(parser["general"]["visible_settings"].split(";"))
|
if "general" in parser and "visible_settings" in parser["general"]:
|
||||||
for removed in _removed_settings:
|
visible_settings = set(parser["general"]["visible_settings"].split(";"))
|
||||||
if removed in visible_settings:
|
for removed in _removed_settings:
|
||||||
visible_settings.remove(removed)
|
if removed in visible_settings:
|
||||||
parser["general"]["visible_settings"] = ";".join(visible_settings)
|
visible_settings.remove(removed)
|
||||||
|
parser["general"]["visible_settings"] = ";".join(visible_settings)
|
||||||
|
|
||||||
result = io.StringIO()
|
result = io.StringIO()
|
||||||
parser.write(result)
|
parser.write(result)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue