From 137bc788c5b9739387210e8a7f346dbf66964dfa Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 7 Mar 2010 17:26:27 +0000 Subject: [PATCH] Fix sort order in flat person view svn: r14671 --- src/gui/views/treemodels/flatbasemodel.py | 4 ++-- src/gui/views/treemodels/peoplemodel.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/views/treemodels/flatbasemodel.py b/src/gui/views/treemodels/flatbasemodel.py index abbbde037..5b2911d34 100644 --- a/src/gui/views/treemodels/flatbasemodel.py +++ b/src/gui/views/treemodels/flatbasemodel.py @@ -516,8 +516,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 diff --git a/src/gui/views/treemodels/peoplemodel.py b/src/gui/views/treemodels/peoplemodel.py index 052dfe9be..521c8a95e 100644 --- a/src/gui/views/treemodels/peoplemodel.py +++ b/src/gui/views/treemodels/peoplemodel.py @@ -178,7 +178,7 @@ class PeopleBaseModel(object): def sort_name(self, data): n = Name() n.unserialize(data[COLUMN_NAME]) - return name_displayer.sort_string(n) + return (n.get_group_name(), n.get_first_name()) def column_name(self, data): handle = data[0]