9094: Double-clicking on a source in the citation gramplet causes exception

This commit is contained in:
SNoiraud 2016-01-28 19:54:52 +01:00
parent 80d710da48
commit f144b4c425

View File

@ -245,7 +245,11 @@ class Citations(Gramplet, DbGUIElement):
model, iter_ = treeview.get_selection().get_selected()
if iter_:
handle = model.get_value(iter_, 0)
if len(str(model.get_path(iter_))) == 1:
# bug 9094.
# str(model.get_path(iter_)) return something like NNN:MMM
# So if we have only NNN, it's a node
path = str(model.get_path(iter_))
if path.find(':') == -1: # we don't have ':' in the returned string.
self.edit_source(handle)
else:
self.edit_citation(handle)