From 390cea6c560694597acf48bfc4ffe270587fb110 Mon Sep 17 00:00:00 2001
From: Julien Pivotto <roidelapluie@esquimaux.be>
Date: Mon, 18 Apr 2011 11:53:46 +0200
Subject: [PATCH] enable clearing search with the icon

---
 data/gui/roster_window.ui |  1 -
 src/roster_window.py      | 10 +++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/data/gui/roster_window.ui b/data/gui/roster_window.ui
index 65f452421b..30b6d066af 100644
--- a/data/gui/roster_window.ui
+++ b/data/gui/roster_window.ui
@@ -352,7 +352,6 @@
 		    <property name="primary_icon_activatable">True</property>
 		    <signal name="changed" handler="on_roster_filter_entry_changed"/>
 		    <signal name="icon_press" handler="on_roster_filter_entry_icon_press"/>
-		    <signal name="key_press_event" handler="on_roster_filter_entry_key_press_event"/>
 		  </object>
                   <packing>
                     <property name="expand">False</property>
diff --git a/src/roster_window.py b/src/roster_window.py
index 72ca0d565a..ad28eafc56 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -4176,11 +4176,11 @@ class RosterWindow:
             self.search_enabled = True
         self.refilter_shown_roster_items()
 
-    def on_roster_filter_entry_icon_press(self, widget):
-        pass
-
-    def on_roster_filter_entry_key_press_event(self, widget):
-        pass
+    def on_roster_filter_entry_icon_press(self, widget, icon, event):
+        """ Disable the roster filtering by clicking the icon in the textEntry """
+        self.xml.get_object('show_roster_filter_menuitem').set_active(False)
+        self.search_enabled = False
+        self.refilter_shown_roster_items()
 
     def on_show_roster_filter_menuitem_toggled(self, widget):
         """ Show the roster filter entry """
-- 
GitLab