Merge #940 from tpikonen/fix-search+arrow-keys
Fix uncaught exception on channel list key navigation
This commit is contained in:
commit
9faf7f21f0
|
@ -717,14 +717,19 @@ class gPodder(BuilderWidget, dbus.service.Object):
|
|||
elif event.keyval in (Gdk.KEY_Up, Gdk.KEY_Down):
|
||||
# If section markers exist in the treeview, we want to
|
||||
# "jump over" them when moving the cursor up and down
|
||||
selection = self.treeChannels.get_selection()
|
||||
model, it = selection.get_selected()
|
||||
|
||||
if event.keyval == Gdk.KEY_Up:
|
||||
step = -1
|
||||
else:
|
||||
step = 1
|
||||
|
||||
selection = self.treeChannels.get_selection()
|
||||
model, it = selection.get_selected()
|
||||
if it is None:
|
||||
it = model.get_iter_first()
|
||||
if it is None:
|
||||
return False
|
||||
step = 1
|
||||
|
||||
path = model.get_path(it)
|
||||
while True:
|
||||
path = (path[0] + step,)
|
||||
|
|
Loading…
Reference in New Issue