mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Only get quality-changes fields for quality-changes profiles
And make the upgrade more robust against weird input, too. Contributes to issue CURA-8510.
This commit is contained in:
parent
a08a5625d2
commit
ef568ce622
1 changed files with 5 additions and 5 deletions
|
@ -73,9 +73,9 @@ class VersionUpgrade411to412(VersionUpgrade):
|
||||||
# Update user-made quality profiles of flsun_sr printers to use the flsun_sr-specific qualities instead of the
|
# Update user-made quality profiles of flsun_sr printers to use the flsun_sr-specific qualities instead of the
|
||||||
# global ones as their base
|
# global ones as their base
|
||||||
file_base_name = os.path.basename(filename) # Remove any path-related characters from the filename
|
file_base_name = os.path.basename(filename) # Remove any path-related characters from the filename
|
||||||
old_definition = parser["general"]["definition"]
|
if file_base_name.startswith("flsun_sr_") and parser["metadata"].get("type") == "quality_changes":
|
||||||
old_quality_type = parser["metadata"]["quality_type"]
|
if "general" in parser and parser["general"].get("definition") == "fdmprinter":
|
||||||
if file_base_name.startswith("flsun_sr") and old_definition == "fdmprinter" and parser["metadata"]["type"] == "quality_changes":
|
old_quality_type = parser["metadata"].get("quality_type", "normal")
|
||||||
parser["general"]["definition"] = "flsun_sr"
|
parser["general"]["definition"] = "flsun_sr"
|
||||||
parser["metadata"]["quality_type"] = self._flsun_quality_type_mapping.get(old_quality_type, "normal")
|
parser["metadata"]["quality_type"] = self._flsun_quality_type_mapping.get(old_quality_type, "normal")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue