Instead of emitting signals for all containers, only emit them for top

This significantly speeds up project loading. CURA-1263
This commit is contained in:
Jaime van Kessel 2016-12-02 16:27:58 +01:00
parent a1acfe167c
commit db18635049

View file

@ -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)