diff --git a/src/gen/display/name.py b/src/gen/display/name.py index 169de4f04..0e5d2f072 100644 --- a/src/gen/display/name.py +++ b/src/gen/display/name.py @@ -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) diff --git a/src/gui/editors/displaytabs/childmodel.py b/src/gui/editors/displaytabs/childmodel.py index 365e2fd17..162f999fb 100644 --- a/src/gui/editors/displaytabs/childmodel.py +++ b/src/gui/editors/displaytabs/childmodel.py @@ -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), ]) diff --git a/src/gui/filtereditor.py b/src/gui/filtereditor.py index a4ce3ef9d..80d9d59ed 100644 --- a/src/gui/filtereditor.py +++ b/src/gui/filtereditor.py @@ -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) diff --git a/src/gui/views/treemodels/familymodel.py b/src/gui/views/treemodels/familymodel.py index 257f03ee3..7a2619c19 100644 --- a/src/gui/views/treemodels/familymodel.py +++ b/src/gui/views/treemodels/familymodel.py @@ -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"" diff --git a/src/gui/views/treemodels/flatbasemodel.py b/src/gui/views/treemodels/flatbasemodel.py index 9636db55f..0b2a12c99 100644 --- a/src/gui/views/treemodels/flatbasemodel.py +++ b/src/gui/views/treemodels/flatbasemodel.py @@ -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 diff --git a/src/gui/views/treemodels/peoplemodel.py b/src/gui/views/treemodels/peoplemodel.py index c9207b776..49cc6ff1e 100644 --- a/src/gui/views/treemodels/peoplemodel.py +++ b/src/gui/views/treemodels/peoplemodel.py @@ -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] diff --git a/src/gui/views/treemodels/treebasemodel.py b/src/gui/views/treemodels/treebasemodel.py index ff08ae00e..322e16035 100644 --- a/src/gui/views/treemodels/treebasemodel.py +++ b/src/gui/views/treemodels/treebasemodel.py @@ -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 diff --git a/src/plugins/webreport/NarrativeWeb.py b/src/plugins/webreport/NarrativeWeb.py index 83f448020..c3e1937e5 100644 --- a/src/plugins/webreport/NarrativeWeb.py +++ b/src/plugins/webreport/NarrativeWeb.py @@ -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 = []