Add version upgrade for infill_hollow -> infill_support

The functionality is more or less the same, so in an attempt to keep people's profiles as similar as possible we translate this setting to the newer implementation.
This commit is contained in:
Ghostkeeper 2018-05-29 11:51:54 +02:00
parent ab2503834b
commit db16a6275f
No known key found for this signature in database
GPG Key ID: 5252B696FB5E7C7A

View File

@ -6,6 +6,9 @@ import io #To serialise the preference files afterwards.
from UM.VersionUpgrade import VersionUpgrade #We're inheriting from this.
_renamed_settings = {
"infill_hollow": "infill_support_enabled"
}
## Upgrades configurations from the state they were in at version 3.3 to the
# state they should be in at version 3.4.
@ -38,6 +41,13 @@ class VersionUpgrade33to34(VersionUpgrade):
# Update version number.
parser["general"]["version"] = "4"
#Renamed settings.
if "values" in parser:
for original, replacement in _renamed_settings.items():
if original in parser["value"]:
parser["value"][replacement] = parser["value"][original]
del parser["value"][original]
result = io.StringIO()
parser.write(result)
return [filename], [result.getvalue()]
return [filename], [result.getvalue()]