Remove superfluous singleton pattern

The qmlRegisterSingletonType function already makes sure it is a singleton.

Contributes to issues CURA-340 and CURA-1278.
This commit is contained in:
Ghostkeeper 2016-06-06 14:32:20 +02:00
parent 7950dfaa07
commit 77c918a0a7

View File

@ -15,9 +15,6 @@ import UM.Signal #To notify other components of changes in the extruders.
# and makes sure that whenever the machine is swapped, this list is kept up to
# date. It also contains and updates the setting stacks for the extruders.
class ExtruderManager(QObject):
## The singleton instance of this manager.
__instance = None
## Signal to notify other components when the list of extruders changes.
extrudersChanged = UM.Signal()
@ -33,16 +30,6 @@ class ExtruderManager(QObject):
self._repopulate()
## Gets an instance of this extruder manager.
#
# If an instance was already created, the old instance is returned. This
# implements the singleton pattern.
@classmethod
def getInstance(cls):
if not cls.__instance:
cls.__instance = ExtruderManager()
return cls.__instance
## Creates an iterator over the extruders in this manager.
#
# \return An iterator over the extruders in this manager.