From 08b66e0872e5ad0e948a988facb18f8eafe1c2e2 Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandre.savard@savoirfairelinux.net>
Date: Fri, 29 May 2009 15:22:08 -0400
Subject: [PATCH] [#1116] Clear text in history and contacts

---
 sflphone-client-gnome/src/contacts/history.c   |  3 +--
 sflphone-client-gnome/src/contacts/searchbar.c | 12 +++---------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/sflphone-client-gnome/src/contacts/history.c b/sflphone-client-gnome/src/contacts/history.c
index 7999bf3b25..f60bb78641 100644
--- a/sflphone-client-gnome/src/contacts/history.c
+++ b/sflphone-client-gnome/src/contacts/history.c
@@ -79,8 +79,7 @@ history_is_visible (GtkTreeModel* model, GtkTreeIter* iter, gpointer data UNUSED
         if(G_VALUE_HOLDS_STRING(&val)){
             text = (gchar *)g_value_get_string(&val);
         }
-        if(text != NULL && 
-                ( g_ascii_strncasecmp(search, _("Search history"), 14) != 0 && g_ascii_strncasecmp(search, _("Search contact"), 14) != 0)){
+        if(text != NULL ){
             return g_regex_match_simple(search, text, G_REGEX_CASELESS, 0);
         }
         g_value_unset (&val);
diff --git a/sflphone-client-gnome/src/contacts/searchbar.c b/sflphone-client-gnome/src/contacts/searchbar.c
index cad09e0670..b2c1ae6215 100644
--- a/sflphone-client-gnome/src/contacts/searchbar.c
+++ b/sflphone-client-gnome/src/contacts/searchbar.c
@@ -102,12 +102,10 @@ GtkWidget* searchbar_new(gchar* searchbar_type) {
   sexy_icon_entry_add_clear_button( SEXY_ICON_ENTRY(searchbox) );
 #endif
 
-  // GTK_WIDGET_SET_FLAGS (GTK_WIDGET(searchbox),GTK_CAN_FOCUS);
-  // gtk_widget_set_name (searchbox, "searchbar");
+
 
   gtk_widget_modify_text(searchbox, GTK_STATE_NORMAL, &GRAY_COLOR); 
 
-  gtk_entry_set_text(GTK_ENTRY(searchbox), _("Search contact"));
   g_signal_connect_after(GTK_ENTRY(searchbox), "changed", G_CALLBACK(searchbar_entry_changed), NULL);
   g_signal_connect_after(GTK_ENTRY(searchbox), "grab-focus", G_CALLBACK(searchbar_clear_entry_if_default), NULL);
 
@@ -118,13 +116,9 @@ GtkWidget* searchbar_new(gchar* searchbar_type) {
 
   gtk_box_pack_start(GTK_BOX(ret), searchbox, TRUE, TRUE, 0);
 
-    if(g_strcmp0(searchbar_type,"history") == 0)
-    {
-        gtk_entry_set_text(GTK_ENTRY(searchbox), _("Search history"));
-        history_set_searchbar_widget(searchbox);
-    }
+  history_set_searchbar_widget(searchbox);
   
-    return ret;
+  return ret;
 }
 
 void activateWaitingLayer() {
-- 
GitLab