java-topology/defects/cura-0001/patch/cura-0001-compatible-machine-model-list-rebuild.patch

17 lines
991 B
Diff

# UNDF: UNDF-2026-000001072
# UNDF: (leave blank — assigned later)
--- a/cura/Machines/Models/CompatibleMachineModel.py
+++ b/cura/Machines/Models/CompatibleMachineModel.py
@@ -47,9 +47,11 @@ class CompatibleMachineModel(ListModel):
machine_manager = CuraApplication.getInstance().getMachineManager()
# Loop over the output-devices, not the stacks; need all applicable configurations, not just the current loaded one.
+ seen_printer_names = {item["name"] for item in self.items} # O(1) membership from here on
for output_device in machine_manager.printerOutputDevices:
for printer in output_device.printers:
extruder_configs = dict()
# If the printer name already exist in the queue skip it
- if printer.name in [item["name"] for item in self.items]:
+ if printer.name in seen_printer_names:
continue
+ seen_printer_names.add(printer.name)