Split up an overly long call into shorter readable bits

This commit is contained in:
Jaime van Kessel 2020-02-28 14:25:50 +01:00
parent 68d70734ee
commit 0ccf457314
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -1507,7 +1507,13 @@ class MachineManager(QObject):
if quality_id == empty_quality_container.getId():
extruder.intent = empty_intent_container
continue
quality_node = container_tree.machines[definition_id].variants[variant_name].materials[material_base_file].qualities[quality_id]
# Yes, we can find this in a single line of code. This makes it easier to read and it has the benefit
# that it doesn't lump key errors together for the crashlogs
machine_node = container_tree.machines[definition_id]
variant_node = machine_node.variants[variant_name]
material_node = variant_node.materials[material_base_file]
quality_node = material_node.qualities[quality_id]
for intent_node in quality_node.intents.values():
if intent_node.intent_category == intent_category: # Found an intent with the correct category.