From 3cc31fd9c2e97e6c64e9c8198e7337013c8a77dd Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 22 Jun 2016 17:39:50 +0200 Subject: [PATCH] When saving containers, use the mime type's preferred suffix instead of a hardcoded value Contributes to CURA-342 --- cura/CuraApplication.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 5f5880e3d5..9ab580eaf2 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -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":