From 194bb5e8c85261e0c6db454525e6f8f2105962a4 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 12 Jun 2018 13:45:58 +0200 Subject: [PATCH] Also send built-in profiles The printer firmware won't add them currently so we're sending these profiles to their doom. However a later firmware update might fix this so we can make older Cura versions send the profiles as well so that it is forward compatible. Contributes to issue CURA-5034. --- plugins/UM3NetworkPrinting/SendMaterialJob.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/UM3NetworkPrinting/SendMaterialJob.py b/plugins/UM3NetworkPrinting/SendMaterialJob.py index 690a0dc0e6..2dbfc5f164 100644 --- a/plugins/UM3NetworkPrinting/SendMaterialJob.py +++ b/plugins/UM3NetworkPrinting/SendMaterialJob.py @@ -72,9 +72,10 @@ class SendMaterialJob(Job): return for file_path in Resources.getAllResourcesOfType(CuraApplication.ResourceTypes.MaterialInstanceContainer): - if not file_path.startswith(Resources.getDataStoragePath() + os.sep): #No built-in profiles. - continue - mime_type = MimeTypeDatabase.getMimeTypeForFile(file_path) + try: + mime_type = MimeTypeDatabase.getMimeTypeForFile(file_path) + except MimeTypeDatabase.MimeTypeNotFoundError: + continue #Not the sort of file we'd like to send then. _, file_name = os.path.split(file_path) material_id = urllib.parse.unquote_plus(mime_type.stripExtension(file_name)) if material_id not in materials_to_send: