From c84cf8d5e36241d2ccb48589496f4d54752a5c54 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Sat, 8 Sep 2007 15:43:27 +0000 Subject: [PATCH] Make use of the search function to correctly find when typing in the 2007-09-08 Xavier Claessens * libempathy-gtk/empathy-contact-list-view.c: * libempathy-gtk/empathy-contact-list-store.c: Make use of the search function to correctly find when typing in the contact list view. Fixes bug #472309 (Will Thompson, Xavier Claessens). svn path=/trunk/; revision=290 --- ChangeLog | 7 +++++++ libempathy-gtk/empathy-contact-list-store.c | 12 ++++++------ libempathy-gtk/empathy-contact-list-view.c | 4 ++++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f078e24..c4120682 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-09-08 Xavier Claessens + + * libempathy-gtk/empathy-contact-list-view.c: + * libempathy-gtk/empathy-contact-list-store.c: Make use of the search + function to correctly find when typing in the contact list view. + Fixes bug #472309 (Will Thompson, Xavier Claessens). + 2007-09-08 Xavier Claessens * libempathy-gtk/empathy-log-window.c: Fix crash if there is no date diff --git a/libempathy-gtk/empathy-contact-list-store.c b/libempathy-gtk/empathy-contact-list-store.c index 9cf03bfe..5301bdc7 100644 --- a/libempathy-gtk/empathy-contact-list-store.c +++ b/libempathy-gtk/empathy-contact-list-store.c @@ -571,10 +571,10 @@ empathy_contact_list_store_get_parent_group (GtkTreeModel *model, gboolean empathy_contact_list_store_search_equal_func (GtkTreeModel *model, - gint column, - const gchar *key, - GtkTreeIter *iter, - gpointer search_data) + gint column, + const gchar *key, + GtkTreeIter *iter, + gpointer search_data) { gchar *name, *name_folded; gchar *key_folded; @@ -583,13 +583,13 @@ empathy_contact_list_store_search_equal_func (GtkTreeModel *model, g_return_val_if_fail (GTK_IS_TREE_MODEL (model), FALSE); if (!key) { - return FALSE; + return TRUE; } gtk_tree_model_get (model, iter, COL_NAME, &name, -1); if (!name) { - return FALSE; + return TRUE; } name_folded = g_utf8_casefold (name, -1); diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 5b3f0de0..4aeac322 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -519,6 +519,10 @@ contact_list_view_setup (EmpathyContactListView *view) priv = GET_PRIV (view); + gtk_tree_view_set_search_equal_func (GTK_TREE_VIEW (view), + empathy_contact_list_store_search_equal_func, + NULL, NULL); + g_signal_connect (priv->store, "row-has-child-toggled", G_CALLBACK (contact_list_view_row_has_child_toggled_cb), view); -- 2.39.2