svn: r7933
This commit is contained in:
Alex Roitman 2007-01-19 17:09:38 +00:00
parent 6d776c2f94
commit a6b17dc87c
3 changed files with 9 additions and 3 deletions

View File

@ -1209,7 +1209,7 @@ class GrampsBSDDB(GrampsDbBase,UpdateCallback):
The function must be overridden in the derived class.
"""
name = str(person.get_primary_name().get_surname())
if self.surnames.keys().count(name) > 1:
if self.surnames.keys().count(name) == 1:
self.surname_list.remove(unicode(name))
def _get_obj_from_gramps_id(self,val,tbl,class_init,prim_tbl):

View File

@ -470,9 +470,10 @@ class GrampsDbBase(GrampsDBCallback):
if old_data:
old_person = Person(old_data)
if (old_data[2] != person.gender or
old_data[3][2]!= person.primary_name.first_name):
old_data[3][4]!= person.primary_name.first_name):
self.genderStats.uncount_person(old_person)
self.genderStats.count_person(person)
if (old_data[3][5]!=person.primary_name.surname):
self.remove_from_surname_list(old_person)
self.add_to_surname_list(person,transaction.batch)
else:

View File

@ -154,15 +154,20 @@ class GrampsInMemDB(GrampsDbBase):
"""
name = str(person.get_primary_name().get_surname())
count = 0
do_remove = True
for person_id in iter(self.person_map):
p = self.get_person_from_handle(person_id)
pn = str(p.get_primary_name().get_surname())
if pn == name:
count += 1
if count > 1:
self.surname_list.remove(unicode(name))
do_remove = False
break
if do_remove:
self.surname_list.remove(unicode(name))
def _del_person(self,handle):
person = self.get_person_from_handle(str(handle))
del self.id_trans[person.get_gramps_id()]