From d0d40cb88444dc019b4ae35e362d75155b72a6f8 Mon Sep 17 00:00:00 2001
From: Alexandre Savard <alexandre.savard@savoirfairelinux.net>
Date: Fri, 20 Mar 2009 11:08:51 -0400
Subject: [PATCH] Init histfilter

---
 sflphone-gtk/src/actions.c  | 2 +-
 sflphone-gtk/src/calltab.h  | 2 +-
 sflphone-gtk/src/calltree.c | 7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sflphone-gtk/src/actions.c b/sflphone-gtk/src/actions.c
index 7443b5ff55..d0be7e9bea 100644
--- a/sflphone-gtk/src/actions.c
+++ b/sflphone-gtk/src/actions.c
@@ -233,7 +233,7 @@ gboolean sflphone_init()
         current_calls = calltab_init(NULL);
         history = calltab_init("history");
         contacts = calltab_init("contacts");
-        //if(SHOW_SEARCHBAR)  histfilter = create_filter(GTK_TREE_MODEL(history->store));
+        histfilter = create_filter(GTK_TREE_MODEL(history->store));
         init();
         account_list_init ();
         codec_list_init();
diff --git a/sflphone-gtk/src/calltab.h b/sflphone-gtk/src/calltab.h
index ce31082f9e..4438d3d8fc 100644
--- a/sflphone-gtk/src/calltab.h
+++ b/sflphone-gtk/src/calltab.h
@@ -23,7 +23,7 @@
 #include <calllist.h>
 #include <gtk/gtk.h>
 
-//GtkTreeModel* histfilter;
+GtkTreeModel* histfilter;
 
 calltab_t* calltab_init(gchar* searchbar_type);
 
diff --git a/sflphone-gtk/src/calltree.c b/sflphone-gtk/src/calltree.c
index dc030e5142..1e2c04fcee 100644
--- a/sflphone-gtk/src/calltree.c
+++ b/sflphone-gtk/src/calltree.c
@@ -844,9 +844,9 @@ create_searchbar(calltab_t* tab, gchar* searchbar_type)
   // g_strcmp0 returns 0 if str1 == str2
   if(g_strcmp0(searchbar_type,"history") == 0){
 
-      GtkTreeIter *iter;
+    // GtkTreeIter *iter;
 
-      GtkTreeModel *model = (GtkTreeModel*)history->store;
+      // GtkTreeModel *model = (GtkTreeModel*)history->store;
 
       // create_filter (model);
       
@@ -858,8 +858,9 @@ create_searchbar(calltab_t* tab, gchar* searchbar_type)
       // create_filter (model);
 
       // is_visible(model, iter);
-
+      
       tab->searchbar = create_filter_entry();
+      gtk_tree_view_set_model(GTK_TREE_VIEW(history->view), GTK_TREE_MODEL(histfilter));
   }
 
   else if(g_strcmp0(searchbar_type,"contacts") == 0)
-- 
GitLab