CURA-4870 Update the selected configuration in the UI when the

configuration in the printer changes.
Modify again the hash function.
This commit is contained in:
Diego Prado Gesto 2018-03-06 09:24:42 +01:00
parent d83eb383d9
commit d02d845d1b
4 changed files with 14 additions and 9 deletions

View file

@ -52,7 +52,13 @@ class ConfigurationModel(QObject):
return hash(self) == hash(other)
def __hash__(self):
extruder_hash = hash(self.extruderConfigurations[0]) # Use the hash of the first extruder as a seed
extruder_hash = hash(0)
first_extruder = None
for configuration in self.extruderConfigurations:
extruder_hash ^= hash(configuration)
if configuration.position == 0:
first_extruder = configuration
if first_extruder:
extruder_hash &= hash(first_extruder)
return hash(self._printer_type) ^ extruder_hash ^ hash(self._buildplate_configuration)