From 77c918a0a7c92a98e499fb0dba22a4e193fac16f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 6 Jun 2016 14:32:20 +0200 Subject: [PATCH] Remove superfluous singleton pattern The qmlRegisterSingletonType function already makes sure it is a singleton. Contributes to issues CURA-340 and CURA-1278. --- cura/ExtruderManager.py | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/cura/ExtruderManager.py b/cura/ExtruderManager.py index 369eb33d51..9785c51c2c 100644 --- a/cura/ExtruderManager.py +++ b/cura/ExtruderManager.py @@ -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.