Ensure that the SettingVisibilityPresetsModel doesn't have duplicated settings

CURA-5734
This commit is contained in:
Jaime van Kessel 2018-10-01 11:51:07 +02:00
parent fc9f05fc8b
commit 7e7afa7c06

View file

@ -81,7 +81,8 @@ class SettingVisibilityPresetsModel(QObject):
# Sort them on weight (and if that fails, use ID) # Sort them on weight (and if that fails, use ID)
items.sort(key = lambda k: (int(k.weight), k.id)) items.sort(key = lambda k: (int(k.weight), k.id))
self.setItems(items) # Set items and ensure there are no duplicated values
self.setItems(list(set(items)))
@pyqtProperty("QVariantList", notify = onItemsChanged) @pyqtProperty("QVariantList", notify = onItemsChanged)
def items(self): def items(self):