mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 14:09:02 +08:00
When saving containers, use the mime type's preferred suffix instead of a hardcoded value
Contributes to CURA-342
This commit is contained in:
parent
8a206b74fd
commit
3cc31fd9c2
@ -251,7 +251,8 @@ class CuraApplication(QtApplication):
|
|||||||
Logger.logException("e", "An exception occurred when serializing container %s", instance.getId())
|
Logger.logException("e", "An exception occurred when serializing container %s", instance.getId())
|
||||||
continue
|
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")
|
instance_type = instance.getMetaDataEntry("type")
|
||||||
path = None
|
path = None
|
||||||
if instance_type == "material":
|
if instance_type == "material":
|
||||||
@ -279,7 +280,8 @@ class CuraApplication(QtApplication):
|
|||||||
Logger.logException("e", "An exception occurred when serializing container %s", instance.getId())
|
Logger.logException("e", "An exception occurred when serializing container %s", instance.getId())
|
||||||
continue
|
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)
|
stack_type = stack.getMetaDataEntry("type", None)
|
||||||
path = None
|
path = None
|
||||||
if not stack_type or stack_type == "machine":
|
if not stack_type or stack_type == "machine":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user