When saving containers, use the mime type's preferred suffix instead of a hardcoded value

Contributes to CURA-342
This commit is contained in:
Arjen Hiemstra 2016-06-22 17:39:50 +02:00
parent 8a206b74fd
commit 3cc31fd9c2

View file

@ -251,7 +251,8 @@ class CuraApplication(QtApplication):
Logger.logException("e", "An exception occurred when serializing container %s", instance.getId())
continue
file_name = urllib.parse.quote_plus(instance.getId()) + ".inst.cfg"
mime_type = ContainerRegistry.getMimeTypeForContainer(type(instance))
file_name = urllib.parse.quote_plus(instance.getId()) + "." + mime_type.preferredSuffix
instance_type = instance.getMetaDataEntry("type")
path = None
if instance_type == "material":
@ -279,7 +280,8 @@ class CuraApplication(QtApplication):
Logger.logException("e", "An exception occurred when serializing container %s", instance.getId())
continue
file_name = urllib.parse.quote_plus(stack.getId()) + ".stack.cfg"
mime_type = ContainerRegistry.getMimeTypeForContainer(type(stack))
file_name = urllib.parse.quote_plus(stack.getId()) + "." + mime_type.preferredSuffix
stack_type = stack.getMetaDataEntry("type", None)
path = None
if not stack_type or stack_type == "machine":