Fix flashing "default" firmware

The url is not QUrl encoded if the "default" firmware is flashed
This commit is contained in:
fieldOfView 2018-07-16 13:26:51 +02:00
parent 7e90546163
commit 65ada30c9c

View file

@ -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()