From 528c8e22266736f6d377ea7edab49bd0288bff57 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 20 Jul 2020 11:48:29 +0200 Subject: [PATCH 1/2] Also store setting_version in preferences file for project files This allows the version upgrade system to update these preferences in order to display the correct list of visible settings. --- plugins/3MFWriter/ThreeMFWorkspaceWriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py index 2e113e0c4f..94628cd2d4 100644 --- a/plugins/3MFWriter/ThreeMFWorkspaceWriter.py +++ b/plugins/3MFWriter/ThreeMFWorkspaceWriter.py @@ -63,7 +63,7 @@ class ThreeMFWorkspaceWriter(WorkspaceWriter): # Write preferences to archive original_preferences = Application.getInstance().getPreferences() #Copy only the preferences that we use to the workspace. temp_preferences = Preferences() - for preference in {"general/visible_settings", "cura/active_mode", "cura/categories_expanded"}: + for preference in {"general/visible_settings", "cura/active_mode", "cura/categories_expanded", "metadata/setting_version"}: temp_preferences.addPreference(preference, None) temp_preferences.setValue(preference, original_preferences.getValue(preference)) preferences_string = StringIO() From 8c4533a2c38cd9d390484aafa22b5533614d1130 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 20 Jul 2020 12:10:08 +0200 Subject: [PATCH 2/2] Fix crash when port gets disconnected while iterating Fixes Sentry issue CURA-11T. --- plugins/USBPrinting/USBPrinterOutputDeviceManager.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py index c5a017db7f..e3834808db 100644 --- a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py +++ b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py @@ -1,4 +1,4 @@ -# Copyright (c) 2018 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import threading @@ -117,6 +117,8 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin): for port in serial.tools.list_ports.comports(): if not isinstance(port, tuple): port = (port.device, port.description, port.hwid) + if not port[2]: # HWID may be None if the port got disconnected while processing. + continue if only_list_usb and not port[2].startswith("USB"): continue