From 0f34e8d6b601478b5457318b36000f2bb651bedb Mon Sep 17 00:00:00 2001 From: Peter Landgren Date: Fri, 21 Nov 2008 15:25:00 +0000 Subject: [PATCH] Fix of issue 2504, sorting in WinXP. svn: r11330 --- src/DisplayModels/_BaseModel.py | 6 +++--- src/DisplayModels/_PeopleModel.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/DisplayModels/_BaseModel.py b/src/DisplayModels/_BaseModel.py index 78ff81ecd..6aa66440a 100644 --- a/src/DisplayModels/_BaseModel.py +++ b/src/DisplayModels/_BaseModel.py @@ -265,9 +265,9 @@ class BaseModel(gtk.GenericTreeModel): (self.search and self.search.match(handle, self.db)): data = self.map(handle) - key = locale.strxfrm(self.sort_func(data)) - self.sort_data.append((key, handle)) - self.sort_data.sort(reverse=self.reverse) + self.sort_data.append((self.sort_func(data), handle)) + self.sort_data.sort(lambda x, y: locale.strcoll(x[0], y[0]), + reverse=self.reverse) self.node_map.set_path_map([ x[1] for x in self.sort_data ]) index = self.node_map.get_path(handle) diff --git a/src/DisplayModels/_PeopleModel.py b/src/DisplayModels/_PeopleModel.py index efd20e6dc..4429678e8 100644 --- a/src/DisplayModels/_PeopleModel.py +++ b/src/DisplayModels/_PeopleModel.py @@ -191,9 +191,9 @@ class NodeTreeMap: return None def build_sub_entry(self, name): - slist = [ (locale.strxfrm(self.sortnames[x]), x) \ + slist = [ (self.sortnames[x], x) \ for x in self.temp_sname_sub[name] ] - slist.sort() + slist.sort(lambda x, y: locale.strcoll(x[0], y[0])) val = 0 for (junk, person_handle) in slist: