Catch when recent file type is not supported. See #192.
This commit is contained in:
parent
0cc60576ab
commit
ced43df1bc
@ -3428,13 +3428,17 @@ class App(QtCore.QObject):
|
||||
for recent in self.recent:
|
||||
filename = recent['filename'].split('/')[-1].split('\\')[-1]
|
||||
|
||||
action = QtGui.QAction(QtGui.QIcon(icons[recent["kind"]]), filename, self)
|
||||
try:
|
||||
action = QtGui.QAction(QtGui.QIcon(icons[recent["kind"]]), filename, self)
|
||||
|
||||
# Attach callback
|
||||
o = make_callback(openers[recent["kind"]], recent['filename'])
|
||||
action.triggered.connect(o)
|
||||
# Attach callback
|
||||
o = make_callback(openers[recent["kind"]], recent['filename'])
|
||||
action.triggered.connect(o)
|
||||
|
||||
self.ui.recent.addAction(action)
|
||||
self.ui.recent.addAction(action)
|
||||
|
||||
except KeyError:
|
||||
App.log.error("Unsupported file type: %s" % recent["kind"])
|
||||
|
||||
# self.builder.get_object('open_recent').set_submenu(recent_menu)
|
||||
# self.ui.menufilerecent.set_submenu(recent_menu)
|
||||
|
Loading…
Reference in New Issue
Block a user