Skip to content

Commit

Permalink
Merge pull request #19683 from Ultimaker/CURA-6842_crash_when_renmain…
Browse files Browse the repository at this point in the history
…g_profiles

Add supress signals when renaming profiles
  • Loading branch information
HellAholic authored Sep 30, 2024
2 parents 9094502 + eb963d7 commit b471526
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cura/Machines/Models/QualityManagementModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,12 @@ def renameQualityChangesGroup(self, quality_changes_group: "QualityChangesGroup"
# have no container for the global stack, because "my_profile" just got renamed to "my_new_profile". This results
# in crashes because the rest of the system assumes that all data in a QualityChangesGroup will be correct.
#
# Renaming the container for the global stack in the end seems to be ok, because the assumption is mostly based
# on the quality changes container for the global stack.
# This is why we use the "supress_signals" flag for the set name. This basically makes the change silent.
for metadata in quality_changes_group.metadata_per_extruder.values():
extruder_container = cast(InstanceContainer, container_registry.findContainers(id = metadata["id"])[0])
extruder_container.setName(new_name)
extruder_container.setName(new_name, supress_signals=True)
global_container = cast(InstanceContainer, container_registry.findContainers(id = quality_changes_group.metadata_for_global["id"])[0])
global_container.setName(new_name)
global_container.setName(new_name, supress_signals=True)

quality_changes_group.name = new_name

Expand Down

0 comments on commit b471526

Please sign in to comment.