From fc6e92e10f15c88e3aff3bf39d0faca6bc91ab83 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 6 Sep 2016 13:07:15 +0200 Subject: [PATCH] Fix uploading custom firmware on windows The simple string replacement left an extraneous "/" in front of the path, which Windows can't handle. QUrl.toLocalFile() does a proper conversion. CURA-955 --- plugins/USBPrinting/USBPrinterOutputDeviceManager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py index 603696f1c6..4dec2e3a06 100644 --- a/plugins/USBPrinting/USBPrinterOutputDeviceManager.py +++ b/plugins/USBPrinting/USBPrinterOutputDeviceManager.py @@ -105,7 +105,8 @@ class USBPrinterOutputDeviceManager(QObject, OutputDevicePlugin, Extension): @pyqtSlot(str) def updateAllFirmware(self, file_name): - file_name = file_name.replace("file://", "") # File dialogs prepend the path with file://, which we don't need / want + if file_name.startswith("file://"): + file_name = QUrl(file_name).toLocalFile() # File dialogs prepend the path with file://, which we don't need / want if not self._usb_output_devices: Message(i18n_catalog.i18nc("@info", "Unable to update firmware because there are no printers connected.")).show() return