From 66677ed1062c18fd63cb13ea9480343a01058c96 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 1 Jan 2003 13:55:35 +0000 Subject: Rewrite ephy node multiple removals to actually work. 2003-01-01 Marco Pesenti Gritti * embed/ephy-history.c: (ephy_history_clear), (ephy_history_remove): * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_clean_empty_keywords): * src/ephy-history-model.c: (get_one_level_path_real), (get_path_real), (root_child_removed_cb): Rewrite ephy node multiple removals to actually work. --- embed/ephy-history.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'embed/ephy-history.c') diff --git a/embed/ephy-history.c b/embed/ephy-history.c index 7c6f08e9d..84875f721 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -719,17 +719,16 @@ ephy_history_set_page_title (EphyHistory *gh, void ephy_history_clear (EphyHistory *gh) { - GPtrArray *children; - int i; + EphyNode *node; - children = ephy_node_get_children (gh->priv->hosts); - ephy_node_thaw (gh->priv->hosts); - for (i = 0; i < children->len; i++) + while ((node = ephy_node_get_nth_child (gh->priv->pages, 0)) != NULL) { - EphyNode *kid; + ephy_node_unref (node); + } - kid = g_ptr_array_index (children, i); - ephy_node_unref (kid); + while ((node = ephy_node_get_nth_child (gh->priv->hosts, 0)) != NULL) + { + ephy_node_unref (node); } ephy_history_save (gh); @@ -765,6 +764,11 @@ ephy_history_remove (EphyHistory *gh, EphyNode *node) host_id = ephy_node_get_property_int (node, EPHY_NODE_PAGE_PROP_HOST_ID); if (host_id < 0) { + EphyNode *tmp; + while ((tmp = ephy_node_get_nth_child (node, 0)) != NULL) + { + ephy_node_unref (tmp); + } ephy_node_unref (node); return; } -- cgit v1.2.3