mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Added typing to all singletons
This greatly helps with pycharms ability to do auto code completion
This commit is contained in:
parent
705158d1f8
commit
437c78711d
2 changed files with 4 additions and 4 deletions
|
@ -16,9 +16,9 @@ class QualityManager:
|
||||||
|
|
||||||
## Get the singleton instance for this class.
|
## Get the singleton instance for this class.
|
||||||
@classmethod
|
@classmethod
|
||||||
def getInstance(cls):
|
def getInstance(cls) -> "QualityManager":
|
||||||
# Note: Explicit use of class name to prevent issues with inheritance.
|
# Note: Explicit use of class name to prevent issues with inheritance.
|
||||||
if QualityManager.__instance is None:
|
if not QualityManager.__instance:
|
||||||
QualityManager.__instance = cls()
|
QualityManager.__instance = cls()
|
||||||
return QualityManager.__instance
|
return QualityManager.__instance
|
||||||
|
|
||||||
|
|
|
@ -32,9 +32,9 @@ class ProfilesModel(InstanceContainersModel):
|
||||||
|
|
||||||
## Get the singleton instance for this class.
|
## Get the singleton instance for this class.
|
||||||
@classmethod
|
@classmethod
|
||||||
def getInstance(cls):
|
def getInstance(cls) -> "ProfilesModel":
|
||||||
# Note: Explicit use of class name to prevent issues with inheritance.
|
# Note: Explicit use of class name to prevent issues with inheritance.
|
||||||
if ProfilesModel.__instance is None:
|
if not ProfilesModel.__instance:
|
||||||
ProfilesModel.__instance = cls()
|
ProfilesModel.__instance = cls()
|
||||||
return ProfilesModel.__instance
|
return ProfilesModel.__instance
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue