Fix conflict detection when there is no definition_changes

CURA-4053

An old project file doesn't have the definition_changes container in the
stacks. When this is the case, Cura should also check if the definition
changes container in an existing stack is empty or not for project file
loading conflict detection.
This commit is contained in:
Lipu Fei 2017-07-20 10:28:07 +02:00
parent 007b529f00
commit 22c1a118a8

View file

@ -256,6 +256,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
container_id = self._old_empty_profile_id_dict.get(container_id, container_id)
# HACK: there used to be 5, now we have one more 5 - definition changes
if len(id_list) == 6 and index == 5:
if global_stack.getContainer(5).getId() != "empty":
machine_conflict = True
break
index = 6
if global_stack.getContainer(index).getId() != container_id:
machine_conflict = True
@ -294,6 +297,9 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
container_id = self._old_empty_profile_id_dict.get(container_id, container_id)
# HACK: there used to be 5, now we have one more 5 - definition changes
if len(id_list) == 6 and index == 5:
if existing_extruder_stack.getContainer(5).getId() != "empty":
machine_conflict = True
break
index = 6
if existing_extruder_stack.getContainer(index).getId() != container_id:
machine_conflict = True