From ea8be3cc345fa197f5717aa63423aabe7c50f938 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 26 Nov 2003 16:42:54 +0000 Subject: [PATCH] * src/gramps_main.py: handle update_after edit properly, so that name changes will put entry in the correct category * src/PeopleView.py: cleanup * src/PeopleStore.py: delete stale iter from dictionary when no longer used. svn: r2387 --- src/PeopleStore.py | 4 ++++ src/PeopleView.py | 11 +++++------ src/gramps_main.py | 8 ++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/PeopleStore.py b/src/PeopleStore.py index e3dad5d85..b6c3dc49e 100644 --- a/src/PeopleStore.py +++ b/src/PeopleStore.py @@ -199,7 +199,11 @@ class PeopleStore: iter_parent = self.model.iter_parent (iter) self.model.remove(iter) if iter_parent and not self.model.iter_has_child (iter_parent): + name = self.model.get_value(iter_parent,0) self.model.remove (iter_parent) + del self.tree_roots[name] + del self.tree_open[name] + del self.tree_list[name] self.count = self.count - 1 def get_row(self,iter): diff --git a/src/PeopleView.py b/src/PeopleView.py index 10963ed1a..9802ccef2 100644 --- a/src/PeopleView.py +++ b/src/PeopleView.py @@ -207,10 +207,10 @@ class PeopleView: self.id2col[key] = (model,iter) - if change: - self.parent.change_active_person(person) - self.goto_active_person() - model.enable_sort() + if change: + self.parent.change_active_person(person) + self.goto_active_person() + model.enable_sort() def goto_active_person(self,first=0): if not self.parent.active_person: @@ -408,8 +408,7 @@ class PeopleView: (model,iter) = self.id2col[key] val = self.parent.db.getPersonDisplay(person.getId()) - pg = unicode(val[5]) - pg = pg[0] + pg = unicode(val[5])[0] if self.DataFilter.compare(person): col = 0 for object in val[:-1]: diff --git a/src/gramps_main.py b/src/gramps_main.py index 132c827c2..25e509f5d 100755 --- a/src/gramps_main.py +++ b/src/gramps_main.py @@ -1585,16 +1585,16 @@ class Gramps: def update_after_edit(self,epo,plist): if epo: - self.db.buildPersonDisplay(epo.person.getId(),epo.original_id) - self.people_view.update_person_list(epo.person,epo.original_id) + self.people_view.remove_from_person_list(epo.person,epo.original_id) + self.people_view.redisplay_person_list(epo.person) for p in plist: self.place_view.new_place_after_edit(p) self.update_display(0) def update_after_merge(self,person,old_id): if person: - self.people_view.remove_from_person_list(person,old_id) - self.people_view.redisplay_person_list(person) + self.people_view.remove_from_person_list(epo.person.getId(),old_id) + self.people_view.redisplay_person_list(epo.person) self.update_display(0) def load_person(self,person):