Correct localized sort in windows using os encoding in the flat views

svn: r12761
This commit is contained in:
Benny Malengier
2009-07-03 22:00:58 +00:00
parent f7454de7fd
commit c8ef93f120
2 changed files with 61 additions and 15 deletions

View File

@@ -74,6 +74,7 @@ import gtk
#-------------------------------------------------------------------------
from Filters import SearchFilter
import Config
from Utils import conv_unicode_tosrtkey_ongtk
#-------------------------------------------------------------------------
#
@@ -449,6 +450,7 @@ class FlatBaseModel(gtk.GenericTreeModel):
"""
Total number of items that maximally can be shown
"""
print 'total asked', self.node_map.max_rows()
return self.node_map.max_rows()
def displayed(self):
@@ -475,8 +477,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( (locale.strxfrm(self.sort_func(data)), key)
for key, data in cursor )
return sorted( (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