mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-20 21:27:50 -06:00
Clean up iterating over cluster list
CURA-8463
This commit is contained in:
parent
7eabbd7b5c
commit
718d3790e2
1 changed files with 5 additions and 1 deletions
|
@ -156,6 +156,7 @@ class CloudOutputDeviceManager:
|
||||||
|
|
||||||
if new_clusters or offline_device_keys or removed_device_keys:
|
if new_clusters or offline_device_keys or removed_device_keys:
|
||||||
self.discoveredDevicesChanged.emit()
|
self.discoveredDevicesChanged.emit()
|
||||||
|
|
||||||
if offline_device_keys:
|
if offline_device_keys:
|
||||||
# If the removed device was active we should connect to the new active device
|
# If the removed device was active we should connect to the new active device
|
||||||
self._connectToActiveMachine()
|
self._connectToActiveMachine()
|
||||||
|
@ -375,7 +376,10 @@ class CloudOutputDeviceManager:
|
||||||
output_device_manager = CuraApplication.getInstance().getOutputDeviceManager()
|
output_device_manager = CuraApplication.getInstance().getOutputDeviceManager()
|
||||||
stored_cluster_id = active_machine.getMetaDataEntry(self.META_CLUSTER_ID)
|
stored_cluster_id = active_machine.getMetaDataEntry(self.META_CLUSTER_ID)
|
||||||
local_network_key = active_machine.getMetaDataEntry(self.META_NETWORK_KEY)
|
local_network_key = active_machine.getMetaDataEntry(self.META_NETWORK_KEY)
|
||||||
for device in list(self._remote_clusters.values()): # Make a copy of the remote devices list, to prevent modifying the list while iterating, if a device gets added asynchronously.
|
|
||||||
|
# Copy of the device list, to prevent modifying the list while iterating, if a device gets added asynchronously.
|
||||||
|
remote_cluster_copy = list(self._remote_clusters.values())
|
||||||
|
for device in remote_cluster_copy:
|
||||||
if device.key == stored_cluster_id:
|
if device.key == stored_cluster_id:
|
||||||
# Connect to it if the stored ID matches.
|
# Connect to it if the stored ID matches.
|
||||||
self._connectToOutputDevice(device, active_machine)
|
self._connectToOutputDevice(device, active_machine)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue