Correct variant name when duplicating materials

It needs to be the variant name (swapping spaces for underscores) to be consistent with the deserialize functions.

Contributes to issue CURA-4243.
This commit is contained in:
Ghostkeeper 2017-12-06 10:40:58 +01:00
parent 3e2e133682
commit 80f4c9181d
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -789,7 +789,8 @@ class ContainerManager(QObject):
if container_to_copy.getMetaDataEntry("definition") != "fdmprinter":
new_id += "_" + container_to_copy.getMetaDataEntry("definition")
if container_to_copy.getMetaDataEntry("variant"):
new_id += "_" + container_to_copy.getMetaDataEntry("variant")
variant = self._container_registry.findContainers(id = container_to_copy.getMetaDataEntry("variant"))[0]
new_id += "_" + variant.getName().replace(" ", "_")
if current_id == material_id:
clone_of_original = new_id