summaryrefslogtreecommitdiff
path: root/portato/gui/windows
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-03-09 21:01:50 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-03-09 21:01:50 +0100
commit9bcef08ae6212926b0f8c04143e0c5ce4dae34b0 (patch)
tree6af5ef9cb0d97530e636a54cd44d61cc7a90fd55 /portato/gui/windows
parent06a6fd0a550a226a2d404d415ee50a249b5ffade (diff)
downloadportato-9bcef08ae6212926b0f8c04143e0c5ce4dae34b0.tar.gz
portato-9bcef08ae6212926b0f8c04143e0c5ce4dae34b0.tar.bz2
portato-9bcef08ae6212926b0f8c04143e0c5ce4dae34b0.zip
Fix the index error on pkglist jump.v0.12.1
Diffstat (limited to '')
-rw-r--r--portato/gui/windows/main.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 5b3bf7e..cbb5bf1 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -1200,7 +1200,15 @@ class MainWindow (Window):
model = self.pkgList.get_model()
if name:
- if model[pos][col] != name: # need to search :(
+ search = False
+ try:
+ row = model[pos]
+ except IndexError: # position not in model
+ search = True
+ else:
+ search = (row[col] != name)
+
+ if search:
debug("Pkg path does not match. Searching...")
for cname, path in ((x[col], x.path) for x in model):
if cname == name:
@@ -1227,7 +1235,15 @@ class MainWindow (Window):
else:
sname = None
- if sname is None and model[pos][col] != name: # need to search in normal list
+ search = False
+ try:
+ row = model[pos]
+ except IndexError: # position not in model
+ search = True
+ else:
+ search = (row[col] != name)
+
+ if sname is None and search: # need to search in normal list
debug("Cat path does not match. Searching...")
for cname, path in ((x[col], x.path) for x in model):
if cname == name: