Always show correct number of connected machines

Calculate number of connected machines _after_ the abstract machine its connected is removed from the list

CURA-9277
This commit is contained in:
c.lamboo 2022-09-02 16:28:10 +02:00
parent 27fc11b840
commit 6d0acbe095

View file

@ -89,12 +89,13 @@ class MachineListModel(ListModel):
machines_manager = CuraApplication.getInstance().getMachineManager()
online_machine_stacks = machines_manager.getMachinesWithDefinition(definition_id, online_only = True)
# Create a list item for abstract machine
self.addItem(abstract_machine, len(online_machine_stacks))
other_machine_stacks.remove(abstract_machine)
if abstract_machine in online_machine_stacks:
online_machine_stacks.remove(abstract_machine)
# Create a list item for abstract machine
self.addItem(abstract_machine, len(online_machine_stacks))
# Create list of machines that are children of the abstract machine
for stack in online_machine_stacks:
if self._show_cloud_printers: