From d24fa3bc3bc7448c56076933e7643ad040e4f12f Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 31 Oct 2017 08:23:57 +0100 Subject: [PATCH] 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. --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 651f2906ff..74d7cc93ee 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -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