From db1863504956df17662c50d8cb96c48703fec435 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 2 Dec 2016 16:27:58 +0100 Subject: [PATCH] Instead of emitting signals for all containers, only emit them for top This significantly speeds up project loading. CURA-1263 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 03f274b632..ddaa1dec00 100644 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -412,16 +412,13 @@ class ThreeMFWorkspaceReader(WorkspaceReader): ExtruderManager.getInstance().registerExtruder(None, global_stack.getId()) Logger.log("d", "Workspace loading is notifying rest of the code of changes...") - # Notify everything/one that is to notify about changes. - for container in global_stack.getContainers(): - global_stack.containersChanged.emit(container) - Job.yieldThread() + # Notify everything/one that is to notify about changes. + global_stack.containersChanged.emit(global_stack.getTop()) + for stack in extruder_stacks: stack.setNextStack(global_stack) - for container in stack.getContainers(): - stack.containersChanged.emit(container) - Job.yieldThread() + stack.containersChanged.emit(stack.getTop()) # Actually change the active machine. Application.getInstance().setGlobalContainerStack(global_stack)