Fixed problem with project saving due to json.dump failing to serialize QString.

This commit is contained in:
Juan Pablo Caram
2014-08-30 22:06:54 -04:00
parent 20c381d510
commit ef30eb5d9c
2 changed files with 21 additions and 1 deletions

View File

@@ -1007,6 +1007,11 @@ class App(QtCore.QObject):
except TypeError:
filename = QtGui.QFileDialog.getOpenFileName(caption="Open Gerber")
# The Qt methods above will return a QString which can cause problems later.
# So far json.dump() will fail to serialize it.
# TODO: Improve the serialization methods and remove this fix.
filename = str(filename)
if str(filename) == "":
self.inform.emit("Open cancelled.")
else:
@@ -1021,6 +1026,11 @@ class App(QtCore.QObject):
except TypeError:
filename = QtGui.QFileDialog.getOpenFileName(caption="Open Excellon")
# The Qt methods above will return a QString which can cause problems later.
# So far json.dump() will fail to serialize it.
# TODO: Improve the serialization methods and remove this fix.
filename = str(filename)
if str(filename) == "":
self.inform.emit("Open cancelled.")
else:
@@ -1036,6 +1046,11 @@ class App(QtCore.QObject):
except TypeError:
filename = QtGui.QFileDialog.getOpenFileName(caption="Open G-Code")
# The Qt methods above will return a QString which can cause problems later.
# So far json.dump() will fail to serialize it.
# TODO: Improve the serialization methods and remove this fix.
filename = str(filename)
if str(filename) == "":
self.inform.emit("Open cancelled.")
else:
@@ -1051,6 +1066,11 @@ class App(QtCore.QObject):
except TypeError:
filename = QtGui.QFileDialog.getOpenFileName(caption="Open Project")
# The Qt methods above will return a QString which can cause problems later.
# So far json.dump() will fail to serialize it.
# TODO: Improve the serialization methods and remove this fix.
filename = str(filename)
if str(filename) == "":
self.inform.emit("Open cancelled.")
else: