Undo revision 16674

svn: r16743
This commit is contained in:
Michiel Nauta 2011-03-02 11:33:36 +00:00
parent 8708c60f33
commit 5af7f07875
8 changed files with 12 additions and 12 deletions

View File

@ -494,7 +494,6 @@ def fn(%s):
#-------------------------------------------------------------------------
# this method will be deleted in the next release.
def sort_string(self, name):
return u"%-25s%-30s%s" % (name.surname, name.first_name, name.suffix)

View File

@ -68,7 +68,7 @@ class ChildModel(gtk.ListStore):
self.column_birth_place(child),
self.column_death_place(child),
child.get_handle(),
name_displayer.sorted_name(child.primary_name),
name_displayer.sort_string(child.primary_name),
self.column_birth_sort(child),
self.column_death_sort(child),
])

View File

@ -905,7 +905,7 @@ class ShowResults(ManagedWindow.ManagedWindow):
def sort_val_from_handle(self, handle):
if self.namespace == 'Person':
name = self.db.get_person_from_handle(handle).get_primary_name()
sortname = _nd.sorted_name(name)
sortname = _nd.sort_string(name)
elif self.namespace == 'Family':
sortname = Utils.family_name(
self.db.get_family_from_handle(handle),self.db)

View File

@ -123,7 +123,7 @@ class FamilyModel(FlatBaseModel):
def sort_father(self, data):
if data[2]:
person = self.db.get_person_from_handle(data[2])
return name_displayer.sorted_name(person.primary_name)
return name_displayer.sort_string(person.primary_name)
else:
return u""
@ -137,7 +137,7 @@ class FamilyModel(FlatBaseModel):
def sort_mother(self, data):
if data[3]:
person = self.db.get_person_from_handle(data[3])
return name_displayer.sorted_name(person.primary_name)
return name_displayer.sort_string(person.primary_name)
else:
return u""

View File

@ -536,8 +536,8 @@ class FlatBaseModel(gtk.GenericTreeModel):
# use cursor as a context manager
with self.gen_cursor() as cursor:
#loop over database and store the sort field, and the handle
return sorted((conv_unicode_tosrtkey_ongtk(self.sort_func(data)),
key) for key, data in cursor)
return sorted((map(conv_unicode_tosrtkey_ongtk,
self.sort_func(data)), key) for key, data in cursor)
def _rebuild_search(self, ignore=None):
""" function called when view must be build, given a search text
@ -604,7 +604,8 @@ class FlatBaseModel(gtk.GenericTreeModel):
Row is only added if search/filter data is such that it must be shown
"""
data = self.map(handle)
insert_val = (conv_unicode_tosrtkey_ongtk(self.sort_func(data)), handle)
insert_val = (map(conv_unicode_tosrtkey_ongtk, self.sort_func(data)),
handle)
if not self.search or \
(self.search and self.search.match(handle, self.db)):
#row needs to be added to the model
@ -638,7 +639,7 @@ class FlatBaseModel(gtk.GenericTreeModel):
return # row is not currently displayed
self.clear_cache(handle)
oldsortkey = self.node_map.get_sortkey(handle)
newsortkey = conv_unicode_tosrtkey_ongtk(self.sort_func(self.map(
newsortkey = map(conv_unicode_tosrtkey_ongtk, self.sort_func(self.map(
handle)))
if oldsortkey is None or oldsortkey != newsortkey:
#or the changed object is not present in the view due to filtering

View File

@ -195,7 +195,7 @@ class PeopleBaseModel(object):
def sort_name(self, data):
n = Name()
n.unserialize(data[COLUMN_NAME])
return name_displayer.sorted_name(n)
return (n.get_surname(), n.get_first_name())
def column_name(self, data):
handle = data[0]

View File

@ -85,7 +85,7 @@ class Node(object):
def __init__(self, ref, parent, sortkey, handle):
self.name = sortkey
if sortkey:
self.sortkey = conv_unicode_tosrtkey_ongtk(sortkey)
self.sortkey = map(conv_unicode_tosrtkey_ongtk, sortkey)
else:
self.sortkey = None
self.ref = ref

View File

@ -6306,7 +6306,7 @@ def sort_people(db, handle_list):
else:
surname = db.get_name_group_mapping(primary_name.surname)
sortnames[person_handle] = _nd.sorted_name(primary_name)
sortnames[person_handle] = _nd.sort_string(primary_name)
sname_sub[surname].append(person_handle)
sorted_lists = []