Make lazy-load container a protected inner class

Contributes to issue CURA-6793.
This commit is contained in:
Ghostkeeper 2019-10-23 09:42:43 +02:00
parent f1e35907d2
commit f69360fb14
No known key found for this signature in database
GPG key ID: 59A4C0959592C05C

View file

@ -39,7 +39,7 @@ class ContainerTree:
return cls.__instance return cls.__instance
def __init__(self) -> None: def __init__(self) -> None:
self.machines = self.MachineNodeMap() # Mapping from definition ID to machine nodes with lazy loading. self.machines = self._MachineNodeMap() # Mapping from definition ID to machine nodes with lazy loading.
self.materialsChanged = Signal() # Emitted when any of the material nodes in the tree got changed. self.materialsChanged = Signal() # Emitted when any of the material nodes in the tree got changed.
cura.CuraApplication.CuraApplication.getInstance().initializationFinished.connect(self._onStartupFinished) # Start the background task to load more machine nodes after start-up is completed. cura.CuraApplication.CuraApplication.getInstance().initializationFinished.connect(self._onStartupFinished) # Start the background task to load more machine nodes after start-up is completed.
@ -82,7 +82,7 @@ class ContainerTree:
## Dictionary-like object that contains the machines. ## Dictionary-like object that contains the machines.
# #
# This handles the lazy loading of MachineNodes. # This handles the lazy loading of MachineNodes.
class MachineNodeMap: class _MachineNodeMap:
def __init__(self) -> None: def __init__(self) -> None:
self._machines = {} # type: Dict[str, MachineNode] self._machines = {} # type: Dict[str, MachineNode]