diff options
author | Davyd Madeley <davyd@madeley.id.au> | 2009-04-11 00:56:10 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2009-04-11 00:56:10 +0800 |
commit | 978a88b55fdafe113dd5d44a5d6c66326bc8deef (patch) | |
tree | 6684eb9c1d81c153e182bb19ec8cc37be72b5e61 /libempathy-gtk | |
parent | 0be2fe4054c559c9dd44b6bcea1f7db2364a73ea (diff) | |
download | gsoc2013-empathy-978a88b55fdafe113dd5d44a5d6c66326bc8deef.tar gsoc2013-empathy-978a88b55fdafe113dd5d44a5d6c66326bc8deef.tar.gz gsoc2013-empathy-978a88b55fdafe113dd5d44a5d6c66326bc8deef.tar.bz2 gsoc2013-empathy-978a88b55fdafe113dd5d44a5d6c66326bc8deef.tar.lz gsoc2013-empathy-978a88b55fdafe113dd5d44a5d6c66326bc8deef.tar.xz gsoc2013-empathy-978a88b55fdafe113dd5d44a5d6c66326bc8deef.tar.zst gsoc2013-empathy-978a88b55fdafe113dd5d44a5d6c66326bc8deef.zip |
Look up the iter of the new tree row on the filter model for set_active_iter
From: Davyd Madeley <davyd@madeley.id.au>
svn path=/trunk/; revision=2807
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-contact-selector.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-contact-selector.c b/libempathy-gtk/empathy-contact-selector.c index 796bc64fb..46e6e63a3 100644 --- a/libempathy-gtk/empathy-contact-selector.c +++ b/libempathy-gtk/empathy-contact-selector.c @@ -104,16 +104,21 @@ static void 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 @@ contact_selector_filter_visible_func (GtkTreeModel *model, 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 @@ contact_selector_filter_visible_func (GtkTreeModel *model, } return visible; - } void |