From 65ada30c9c45687f6fe860af7ecc74889978a3a1 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Mon, 16 Jul 2018 13:26:51 +0200 Subject: [PATCH] Fix flashing "default" firmware The url is not QUrl encoded if the "default" firmware is flashed --- plugins/USBPrinting/USBPrinterOutputDevice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 926cd9001d..6a97a3c163 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -127,8 +127,11 @@ class USBPrinterOutputDevice(PrinterOutputDevice): @pyqtSlot(str) def updateFirmware(self, file): - # the file path is qurl encoded. - self._firmware_location = QUrl(file).toLocalFile() + # the file path could be qurl encoded. + if file[:7] == "file://": + self._firmware_location = QUrl(file).toLocalFile() + else: + self._firmware_location = file self.showFirmwareInterface() self.setFirmwareUpdateState(FirmwareUpdateState.updating) self._update_firmware_thread.start()