mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 12:19:03 +08:00
Fix empty containers in stack upgrade
This commit is contained in:
parent
b875f06baf
commit
8cad79831a
@ -45,6 +45,15 @@ _OLD_NOT_SUPPORTED_PROFILES = [
|
||||
]
|
||||
|
||||
|
||||
# Some containers have their specific empty containers, those need to be set correctly.
|
||||
_EMPTY_CONTAINER_DICT = {
|
||||
"1": "empty_quality_changes",
|
||||
"2": "empty_quality",
|
||||
"3": "empty_material",
|
||||
"4": "empty_variant",
|
||||
}
|
||||
|
||||
|
||||
class VersionUpgrade30to31(VersionUpgrade):
|
||||
## Gets the version number from a CFG file in Uranium's 3.0 format.
|
||||
#
|
||||
@ -126,6 +135,11 @@ class VersionUpgrade30to31(VersionUpgrade):
|
||||
if quality_profile_id in _OLD_NOT_SUPPORTED_PROFILES:
|
||||
parser["containers"]["2"] = "empty_quality"
|
||||
|
||||
# fix empty containers
|
||||
for key, specific_empty_container in _EMPTY_CONTAINER_DICT:
|
||||
if parser.has_option("containers", key) and parser["containers"][key] == "empty":
|
||||
parser["containers"][key] = specific_empty_container
|
||||
|
||||
# Update version numbers
|
||||
if "general" not in parser:
|
||||
parser["general"] = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user