Pass optional file_name for deserialization

CURA-4613

Some upgrades depend on the file_name, so the file_name is needed in
this case.
This commit is contained in:
Lipu Fei 2017-11-23 11:26:53 +01:00
parent 1b76d08f01
commit 18c7a5acf3
4 changed files with 31 additions and 21 deletions

View file

@ -422,11 +422,11 @@ class XmlMaterialProfile(InstanceContainer):
return version * 1000000 + setting_version
## Overridden from InstanceContainer
def deserialize(self, serialized):
def deserialize(self, serialized, file_name = None):
containers_to_add = []
# update the serialized data first
from UM.Settings.Interfaces import ContainerInterface
serialized = ContainerInterface.deserialize(self, serialized)
serialized = ContainerInterface.deserialize(self, serialized, file_name)
try:
data = ET.fromstring(serialized)