Set name directly in metadata when clearing

Because the setName function checks if the name is equal to the previous name, but at that point the previous name doesn't exist.

Contributes to issue CURA-4243.
This commit is contained in:
Ghostkeeper 2017-10-31 08:23:57 +01:00
parent 8eaec149fa
commit d24fa3bc3b
No known key found for this signature in database
GPG key ID: 5252B696FB5E7C7A

View file

@ -386,8 +386,10 @@ class XmlMaterialProfile(InstanceContainer):
first.append(element)
def clearData(self):
self._metadata = {"id": self.getId()}
self.setName("")
self._metadata = {
"id": self.getId(),
"name": ""
}
self._definition = None
self._instances = {}
self._read_only = False