mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Move LegacyProfileReader-specific logic into the plug-in itself
This had the documentation that it should edit the profiles returned by LegacyProfileReader. Instead, just return correct profiles from the reader... Contributes to issue CURA-4715.
This commit is contained in:
parent
c6a2b1b9c9
commit
05e232b498
2 changed files with 14 additions and 21 deletions
|
@ -218,25 +218,6 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||
if type(profile_or_list) is not list:
|
||||
profile_or_list = [profile_or_list]
|
||||
|
||||
if len(profile_or_list) == 1:
|
||||
# If there is only 1 stack file it means we're loading a legacy (pre-3.1) .curaprofile.
|
||||
# In that case we find the per-extruder settings and put those in a new quality_changes container
|
||||
# so that it is compatible with the new stack setup.
|
||||
profile = profile_or_list[0]
|
||||
extruder_stack_quality_changes_container = ContainerManager.getInstance().duplicateContainerInstance(profile)
|
||||
extruder_stack_quality_changes_container.addMetaDataEntry("extruder", "fdmextruder")
|
||||
|
||||
for quality_changes_setting_key in extruder_stack_quality_changes_container.getAllKeys():
|
||||
settable_per_extruder = extruder_stack_quality_changes_container.getProperty(quality_changes_setting_key, "settable_per_extruder")
|
||||
if settable_per_extruder:
|
||||
profile.removeInstance(quality_changes_setting_key, postpone_emit = True)
|
||||
else:
|
||||
extruder_stack_quality_changes_container.removeInstance(quality_changes_setting_key, postpone_emit = True)
|
||||
|
||||
# We add the new container to the profile list so things like extruder positions are taken care of
|
||||
# in the next code segment.
|
||||
profile_or_list.append(extruder_stack_quality_changes_container)
|
||||
|
||||
# Import all profiles
|
||||
for profile_index, profile in enumerate(profile_or_list):
|
||||
if profile_index == 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue