Simplify detection of url-encoded filepatch

This commit is contained in:
fieldOfView 2018-07-31 09:47:18 +02:00
parent 65ada30c9c
commit 846c55a99d

View file

@ -127,8 +127,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice):
@pyqtSlot(str)
def updateFirmware(self, file):
# the file path could be qurl encoded.
if file[:7] == "file://":
# the file path could be url-encoded.
if file.startswith("file://"):
self._firmware_location = QUrl(file).toLocalFile()
else:
self._firmware_location = file