Use self._definition instead of local definition parameter

This is supposedly more defensive coding.

Contributes to issues CURA-1278 and CURA-351.
This commit is contained in:
Ghostkeeper 2016-06-01 15:16:39 +02:00
parent 7f7b56ff08
commit 72bc68f38a
No known key found for this signature in database
GPG Key ID: 701948C5954A7385

View File

@ -17,10 +17,10 @@ class Extruder:
container_registry = UM.Settings.ContainerRegistry.getInstance() container_registry = UM.Settings.ContainerRegistry.getInstance()
#Find the nozzles that fit on this extruder. #Find the nozzles that fit on this extruder.
self._nozzles = container_registry.findInstanceContainers(type = "nozzle", definitions = "*," + definition.getId() + ",*") #Extruder needs to be delimited by either a comma or the end of string. self._nozzles = container_registry.findInstanceContainers(type = "nozzle", definitions = "*," + self._definition.getId() + ",*") #Extruder needs to be delimited by either a comma or the end of string.
self._nozzles += container_registry.findInstanceContainers(type = "nozzle", definitions = "*," + definition.getId()) self._nozzles += container_registry.findInstanceContainers(type = "nozzle", definitions = "*," + self._definition.getId())
self._nozzles += container_registry.findInstanceContainers(type = "nozzle", definitions = definition.getId() + ",*") self._nozzles += container_registry.findInstanceContainers(type = "nozzle", definitions = self._definition.getId() + ",*")
self._nozzles += container_registry.findInstanceContainers(type = "nozzle", definitions = definition.getId()) self._nozzles += container_registry.findInstanceContainers(type = "nozzle", definitions = self._definition.getId())
#Create a container stack for this extruder. #Create a container stack for this extruder.
self._container_stack = UM.Settings.ContainerStack(self._uniqueName(self._definition.getId())) self._container_stack = UM.Settings.ContainerStack(self._uniqueName(self._definition.getId()))