Make tag browser filtering work when capital letters are entered.

This commit is contained in:
Charles Haley 2012-04-04 11:15:43 +02:00
parent 39fd2fa859
commit 6c505b1242
3 changed files with 13 additions and 4 deletions

View file

@ -840,6 +840,15 @@ def _get_category_nodes(self, sort):
self.categories[category] = tb_categories[category]['name']
return data
def set_categories_filter(self, txt):
if txt:
self.filter_categories_by = icu_lower(txt)
else:
self.filter_categories_by = None
def get_categories_filter(self):
return self.filter_categories_by
def refresh(self, data=None):
'''
Here to trap usages of refresh in the old architecture. Can eventually

View file

@ -443,12 +443,12 @@ def find(self):
txt = unicode(self.item_search.currentText()).strip()
if txt.startswith('*'):
model.filter_categories_by = txt[1:]
model.set_categories_filter(txt[1:])
self.tags_view.recount()
self.current_find_position = None
return
if model.filter_categories_by:
model.filter_categories_by = None
if model.get_categories_filter():
model.set_categories_filter(None)
self.tags_view.recount()
self.current_find_position = None

View file

@ -302,7 +302,7 @@ def context_menu_handler(self, action=None, category=None,
self.hidden_categories.clear()
self.db.prefs.set('tag_browser_hidden_categories', list(self.hidden_categories))
if reset_filter_categories:
self._model.filter_categories_by = None
self._model.set_categories_filter(None)
self._model.rebuild_node_tree()
except:
return