mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 23:15:12 +08:00
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:
parent
7950dfaa07
commit
77c918a0a7
@ -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
|
# 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.
|
# date. It also contains and updates the setting stacks for the extruders.
|
||||||
class ExtruderManager(QObject):
|
class ExtruderManager(QObject):
|
||||||
## The singleton instance of this manager.
|
|
||||||
__instance = None
|
|
||||||
|
|
||||||
## Signal to notify other components when the list of extruders changes.
|
## Signal to notify other components when the list of extruders changes.
|
||||||
extrudersChanged = UM.Signal()
|
extrudersChanged = UM.Signal()
|
||||||
|
|
||||||
@ -33,16 +30,6 @@ class ExtruderManager(QObject):
|
|||||||
|
|
||||||
self._repopulate()
|
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.
|
## Creates an iterator over the extruders in this manager.
|
||||||
#
|
#
|
||||||
# \return An iterator over the extruders in this manager.
|
# \return An iterator over the extruders in this manager.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user