[GTKUI] Listview use lambda func for set_default_sort_func

* gi complains about `None` value being passed to set_default_sort_func
   so for compatibility use lamba func that does nothing.

   There is an unanswered question on SO about how to set the default func to None in gi:
   http://stackoverflow.com/questions/20940324/how-to-remove-the-default-sort-function-from-a-treesortable
This commit is contained in:
Calum Lind 2016-11-10 11:41:53 +00:00 committed by Calum Lind
parent a5b07aa4ef
commit 8ba8aec277

View File

@ -188,7 +188,7 @@ class ListView(object):
# Using the default sort column
elif self.default_sort_column_id:
self.model_filter.set_sort_column_id(self.default_sort_column_id, gtk.SORT_ASCENDING)
self.model_filter.set_default_sort_func(None)
self.model_filter.set_default_sort_func(lambda x: None)
def get_sort_column_from_state(self):
"""Find the first (should only be one) state with sort enabled"""