diff options
Diffstat (limited to 'libempathy-gtk/empathy-contact-list-view.c')
-rw-r--r-- | libempathy-gtk/empathy-contact-list-view.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c index 8d0cd784f..208306c3d 100644 --- a/libempathy-gtk/empathy-contact-list-view.c +++ b/libempathy-gtk/empathy-contact-list-view.c @@ -149,6 +149,8 @@ contact_list_view_is_visible_contact (EmpathyContactListView *self, gchar *dup_str = NULL; gboolean visible; + g_assert (live != NULL); + /* check alias name */ str = empathy_contact_get_name (contact); if (empathy_live_search_match (live, str)) @@ -183,7 +185,8 @@ contact_list_view_filter_visible_func (GtkTreeModel *model, GtkTreeIter child_iter; gboolean visible; - if (!gtk_widget_get_visible (priv->search_widget)) + if (priv->search_widget == NULL || + !gtk_widget_get_visible (priv->search_widget)) return TRUE; gtk_tree_model_get (model, iter, @@ -1291,7 +1294,7 @@ contact_list_view_search_show_cb (EmpathyLiveSearch *search, typedef struct { EmpathyContactListView *view; - GtkTreePath *path; + GtkTreeRowReference *row_ref; gboolean expand; } ExpandData; @@ -1299,25 +1302,31 @@ static gboolean contact_list_view_expand_idle_cb (gpointer user_data) { ExpandData *data = user_data; + GtkTreePath *path; + + path = gtk_tree_row_reference_get_path (data->row_ref); + if (path == NULL) + goto done; g_signal_handlers_block_by_func (data->view, contact_list_view_row_expand_or_collapse_cb, GINT_TO_POINTER (data->expand)); if (data->expand) { - gtk_tree_view_expand_row (GTK_TREE_VIEW (data->view), - data->path, TRUE); + gtk_tree_view_expand_row (GTK_TREE_VIEW (data->view), path, + TRUE); } else { - gtk_tree_view_collapse_row (GTK_TREE_VIEW (data->view), - data->path); + gtk_tree_view_collapse_row (GTK_TREE_VIEW (data->view), path); } + gtk_tree_path_free (path); g_signal_handlers_unblock_by_func (data->view, contact_list_view_row_expand_or_collapse_cb, GINT_TO_POINTER (data->expand)); +done: g_object_unref (data->view); - gtk_tree_path_free (data->path); + gtk_tree_row_reference_free (data->row_ref); g_slice_free (ExpandData, data); return FALSE; @@ -1346,7 +1355,7 @@ contact_list_view_row_has_child_toggled_cb (GtkTreeModel *model, data = g_slice_new0 (ExpandData); data->view = g_object_ref (view); - data->path = gtk_tree_path_copy (path); + data->row_ref = gtk_tree_row_reference_new (model, path); data->expand = (priv->list_features & EMPATHY_CONTACT_LIST_FEATURE_GROUPS_SAVE) == 0 || (priv->search_widget != NULL && gtk_widget_get_visible (priv->search_widget)) || |