diff options
author | Remco Burema <r.burema@ultimaker.com> | 2019-11-07 19:19:18 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2019-11-07 19:19:18 +0300 |
commit | 3636eed96441e3c7e57bb1c519b7efb8e4c1bc37 (patch) | |
tree | 1ffe24b3fdb887fc8b0df02e7e83fab5bce41982 | |
parent | 6e79f489e2087c32c84d82390ad514340165ff96 (diff) |
Instead of selecting first, return only uniques.
part of CURA-6917
-rw-r--r-- | cura/Settings/ContainerManager.py | 4 | ||||
-rw-r--r-- | resources/qml/Preferences/Materials/MaterialsView.qml | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py index f2917ca21f..ff129d35e2 100644 --- a/cura/Settings/ContainerManager.py +++ b/cura/Settings/ContainerManager.py @@ -341,9 +341,9 @@ class ContainerManager(QObject): def getLinkedMaterials(self, material_node: "MaterialNode", exclude_self: bool = False) -> List[str]: same_guid = ContainerRegistry.getInstance().findInstanceContainersMetadata(GUID = material_node.guid) if exclude_self: - return [metadata["name"] for metadata in same_guid if metadata["base_file"] != material_node.base_file] + return list({meta["name"] for meta in same_guid if meta["base_file"] != material_node.base_file}) else: - return [metadata["name"] for metadata in same_guid] + return list({meta["name"] for meta in same_guid}) ## Unlink a material from all other materials by creating a new GUID # \param material_id \type{str} the id of the material to create a new GUID for. diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 8ada441f1e..57253b9dff 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -46,7 +46,7 @@ TabView { return "" } - return linkedMaterials[0]; + return linkedMaterials; } function getApproximateDiameter(diameter) |