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
This commit is contained in:
fieldOfView 2016-09-06 13:07:15 +02:00
parent dc01cdbc88
commit fc6e92e10f

View file

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