From eeae242437aca16e9b7d6d6cc45f3e5bf90f4aaa Mon Sep 17 00:00:00 2001 From: Diego Escalante Urrelo Date: Mon, 8 Jan 2007 22:53:47 +0000 Subject: Workaround/semi-fix for bug #351814. The real cause of the problem is the 2007-01-08 Diego Escalante Urrelo * src/bookmarks/ephy-bookmarks-editor.c: * lib/widgets/ephy-node-view.c: Workaround/semi-fix for bug #351814. The real cause of the problem is the user_data that is never set on a GtkTreeIter, so the Ephy implementation of the tree makes it to have a stamp of 0 being that way an invalid iter. Patch by Diego Escalante Urrelo. svn path=/trunk/; revision=6796 --- lib/widgets/ephy-node-view.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/widgets/ephy-node-view.c b/lib/widgets/ephy-node-view.c index b94867cf3..078496591 100644 --- a/lib/widgets/ephy-node-view.c +++ b/lib/widgets/ephy-node-view.c @@ -160,16 +160,21 @@ static EphyNode * get_node_from_path (EphyNodeView *view, GtkTreePath *path) { EphyNode *node; - GtkTreeIter iter, iter2; + GtkTreeIter iter, iter2, iter3; if (path == NULL) return NULL; gtk_tree_model_get_iter (view->priv->sortmodel, &iter, path); gtk_tree_model_sort_convert_iter_to_child_iter (GTK_TREE_MODEL_SORT (view->priv->sortmodel), &iter2, &iter); + + if (iter2.stamp == 0) { + return NULL; + } gtk_tree_model_filter_convert_iter_to_child_iter - (GTK_TREE_MODEL_FILTER (view->priv->filtermodel), &iter, &iter2); - node = ephy_tree_model_node_node_from_iter (view->priv->nodemodel, &iter); + (GTK_TREE_MODEL_FILTER (view->priv->filtermodel), &iter3, &iter2); + + node = ephy_tree_model_node_node_from_iter (view->priv->nodemodel, &iter3); return node; } @@ -1373,7 +1378,7 @@ ephy_node_view_remove (EphyNodeView *view) EphyNodeViewPrivate *priv = view->priv; GList *list, *l; EphyNode *node; - GtkTreeIter iter, iter2; + GtkTreeIter iter, iter2, iter3; GtkTreePath *path; GtkTreeRowReference *row_ref = NULL; GtkTreeSelection *selection; @@ -1388,9 +1393,9 @@ ephy_node_view_remove (EphyNodeView *view) node = g_list_first (list)->data; ephy_tree_model_node_iter_from_node (EPHY_TREE_MODEL_NODE (view->priv->nodemodel), - node, &iter); + node, &iter3); gtk_tree_model_filter_convert_child_iter_to_iter (GTK_TREE_MODEL_FILTER (view->priv->filtermodel), - &iter2, &iter); + &iter2, &iter3); gtk_tree_model_sort_convert_child_iter_to_iter (GTK_TREE_MODEL_SORT (view->priv->sortmodel), &iter, &iter2); iter2 = iter; -- cgit