Make code a bit smarter about reusing ExtruderConfigurationModels

This prevents a lot of unneeded signal noise
This commit is contained in:
Jaime van Kessel 2019-10-11 11:04:16 +02:00
parent ee25c4b94c
commit 05a6c9c3cf
No known key found for this signature in database
GPG key ID: 3710727397403C91
2 changed files with 13 additions and 4 deletions

View file

@ -34,3 +34,11 @@ class MaterialOutputModel(QObject):
@pyqtProperty(str, constant = True)
def name(self) -> str:
return self._name
def __eq__(self, other):
if self is other:
return True
if type(other) is not MaterialOutputModel:
return False
return self.guid == other.guid and self.type == other.type and self.brand == other.brand and self.color == other.color and self.name == other.name