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:
Ghostkeeper 2017-12-19 17:16:32 +01:00
parent c6a2b1b9c9
commit 05e232b498
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A
2 changed files with 14 additions and 21 deletions

View file

@ -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: