From 12fc03ecdc4a8f320d72166a4b91df75cc6f5ee4 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Thu, 17 Jan 2008 22:48:34 +0000 Subject: [PATCH] define a search function that escapes text as it's escaped in treemodel. fixes #3668 --- src/roster_window.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/roster_window.py b/src/roster_window.py index c52345755..7da8e5293 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -5323,6 +5323,11 @@ class RosterWindow: self._last_selected_contact.append((jid, account)) self.draw_contact(jid, account, selected = True) + def search_roster_func(self, model, column, key, iter): + if model[iter][C_NAME].decode('utf-8').startswith(gobject.markup_escape_text(key)): + return False + return True + def setup_for_osx(self): # Massage the GTK menu so it will match up to the OS/X nib style menu # when passed to sync-menu and merged @@ -5565,6 +5570,9 @@ class RosterWindow: col.set_visible(False) self.tree.set_expander_column(col) + # set search function + self.tree.set_search_equal_func(self.search_roster_func) + # signals self.TARGET_TYPE_URI_LIST = 80 TARGETS = [('MY_TREE_MODEL_ROW', gtk.TARGET_SAME_APP | gtk.TARGET_SAME_WIDGET,