diff options
author | Nino van Hooff <ninovanhooff@gmail.com> | 2020-07-15 17:08:18 +0300 |
---|---|---|
committer | Nino van Hooff <ninovanhooff@gmail.com> | 2020-07-15 17:08:18 +0300 |
commit | 18cdce6ef0a3b616ad8d0b8a529594758c6ac9ea (patch) | |
tree | 79b4ae0233c2cc27a7282170ecaff29cc106bad5 /plugins/VersionUpgrade | |
parent | bc51db321f9d6c0552d944273d06d56b1f0df2b1 (diff) |
Add support_structure to custom visible settings if support_tree_enable
is in that list
CURA-6711
Diffstat (limited to 'plugins/VersionUpgrade')
-rw-r--r-- | plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py index cb2e17dae5..93edab4d58 100644 --- a/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py +++ b/plugins/VersionUpgrade/VersionUpgrade462to47/VersionUpgrade462to47.py @@ -40,10 +40,18 @@ class VersionUpgrade462to47(VersionUpgrade): # Update version number. parser["metadata"]["setting_version"] = "15" - # Remove deleted settings from the visible settings list. if "general" in parser and "visible_settings" in parser["general"]: - parser["general"]["visible_settings"] = ";".join( - set(parser["general"]["visible_settings"].split(";")).difference(_removed_settings)) + settings = set(parser["general"]["visible_settings"].split(";")) + + # add support_structure to the visible settings list if necessary + if "support_tree_enable" in parser["general"]["visible_settings"]: + settings.add("support_structure") + + # Remove deleted settings from the visible settings list. + settings.difference_update(_removed_settings) + + # serialize + parser["general"]["visible_settings"] = ";".join(settings) result = io.StringIO() parser.write(result) |