diff --git a/gramps2/src/GrampsDb/_GrampsBSDDB.py b/gramps2/src/GrampsDb/_GrampsBSDDB.py index ce5119c33..64c71bba3 100644 --- a/gramps2/src/GrampsDb/_GrampsBSDDB.py +++ b/gramps2/src/GrampsDb/_GrampsBSDDB.py @@ -84,16 +84,24 @@ def find_primary_handle(key,data): def find_referenced_handle(key,data): return str((data)[1][1]) +import cPickle as pickle + class GrampsBSDDBCursor(GrampsCursor): def __init__(self,source,txn=None): - self.cursor = source.cursor(txn) + self.cursor = source.db.cursor(txn) def first(self): - return self.cursor.first() + d = self.cursor.first() + if d: + return (d[0],pickle.loads(d[1])) + return None def next(self): - return self.cursor.next() + d = self.cursor.next() + if d: + return (d[0],pickle.loads(d[1])) + return None def close(self): self.cursor.close() diff --git a/gramps2/src/PeopleModel.py b/gramps2/src/PeopleModel.py index 36063529d..5f40599e1 100644 --- a/gramps2/src/PeopleModel.py +++ b/gramps2/src/PeopleModel.py @@ -149,12 +149,11 @@ class PeopleModel(gtk.GenericTreeModel): self.sortnames = {} - cursor = self.db.person_map.db.cursor() + cursor = self.db.get_person_cursor() node = cursor.first() while node: handle,d = node - d = pickle.loads(d) if not (handle in skip or (dfilter and not dfilter.match(handle))): name_data = d[_NAME_COL] self.sortnames[handle] = nsn(name_data)