empathy r2807 - trunk/libempathy-gtk



Author: xclaesse
Date: Fri Apr 10 16:56:10 2009
New Revision: 2807
URL: http://svn.gnome.org/viewvc/empathy?rev=2807&view=rev

Log:
Look up the iter of the new tree row on the filter model for set_active_iter

From: Davyd Madeley <davyd madeley id au>

Modified:
   trunk/libempathy-gtk/empathy-contact-selector.c

Modified: trunk/libempathy-gtk/empathy-contact-selector.c
==============================================================================
--- trunk/libempathy-gtk/empathy-contact-selector.c	(original)
+++ trunk/libempathy-gtk/empathy-contact-selector.c	Fri Apr 10 16:56:10 2009
@@ -104,16 +104,21 @@
 contact_selector_add_blank_contact (EmpathyContactSelector *selector)
 {
   EmpathyContactSelectorPriv *priv = GET_PRIV (selector);
-  GtkTreeIter blank_iter;
+  GtkTreeIter blank_iter, iter;
 
   gtk_tree_store_insert_with_values (
       GTK_TREE_STORE (priv->store), &blank_iter, NULL, 0,
       EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, NULL,
       EMPATHY_CONTACT_LIST_STORE_COL_NAME, (_("Select a contact")),
       EMPATHY_CONTACT_LIST_STORE_COL_IS_ONLINE, FALSE, -1);
+
+  /* look up blank_iter in the filter model */
+  g_return_if_fail (gtk_tree_model_filter_convert_child_iter_to_iter (
+      GTK_TREE_MODEL_FILTER (priv->model), &iter, &blank_iter));
+
   g_signal_handlers_block_by_func (selector,
       contact_selector_manage_blank_contact, selector);
-  gtk_combo_box_set_active_iter (GTK_COMBO_BOX (selector), &blank_iter);
+  gtk_combo_box_set_active_iter (GTK_COMBO_BOX (selector), &iter);
   g_signal_handlers_unblock_by_func (selector,
       contact_selector_manage_blank_contact, selector);
 }
@@ -367,10 +372,12 @@
 				      gpointer user_data)
 {
   EmpathyContact *contact;
-  gboolean visible = FALSE;
+  gboolean visible = TRUE;
   FilterData *data = (FilterData *) user_data;
 
-  gtk_tree_model_get (model, iter, 0, &contact, -1);
+  gtk_tree_model_get (model, iter,
+      EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact,
+      -1);
 
   if (contact != NULL)
     {
@@ -380,7 +387,6 @@
     }
 
   return visible;
-
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]