mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07: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
1 changed files with 4 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue