Fix nondetermistic result with dictionary values list

Because global_stack.extruders.values can be returned in any order, the configurations matching with the lists doesn't always give a result.
It happened to work on my computer with the test, but there is no guarantee of that.

This is probably also going wrong in other places. I don't think we should use the .extruders property anywhere really!

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-09-06 17:15:45 +02:00
parent d618f2df71
commit 4bdc819f12
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
2 changed files with 5 additions and 5 deletions

View file

@ -53,9 +53,9 @@ class ContainerTree:
global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack()
if global_stack is None:
return {}
variant_names = [extruder.variant.getName() for extruder in global_stack.extruders.values()]
material_bases = [extruder.material.getMetaDataEntry("base_file") for extruder in global_stack.extruders.values()]
extruder_enabled = [extruder.isEnabled for extruder in global_stack.extruders.values()]
variant_names = [extruder.variant.getName() for extruder in global_stack.extrudersList]
material_bases = [extruder.material.getMetaDataEntry("base_file") for extruder in global_stack.extrudersList]
extruder_enabled = [extruder.isEnabled for extruder in global_stack.extrudersList]
return self.machines[global_stack.definition.getId()].getQualityGroups(variant_names, material_bases, extruder_enabled)
## Get the quality changes groups available for the currently activated