aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-history.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-01-01 21:55:35 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-01-01 21:55:35 +0800
commit66677ed1062c18fd63cb13ea9480343a01058c96 (patch)
treeffce8e92e2b264f2a819bac2606c8822976fb6c3 /embed/ephy-history.c
parenta4f9aed333d06c864f4ed719fa41eda82eff4713 (diff)
downloadgsoc2013-epiphany-66677ed1062c18fd63cb13ea9480343a01058c96.tar
gsoc2013-epiphany-66677ed1062c18fd63cb13ea9480343a01058c96.tar.gz
gsoc2013-epiphany-66677ed1062c18fd63cb13ea9480343a01058c96.tar.bz2
gsoc2013-epiphany-66677ed1062c18fd63cb13ea9480343a01058c96.tar.lz
gsoc2013-epiphany-66677ed1062c18fd63cb13ea9480343a01058c96.tar.xz
gsoc2013-epiphany-66677ed1062c18fd63cb13ea9480343a01058c96.tar.zst
gsoc2013-epiphany-66677ed1062c18fd63cb13ea9480343a01058c96.zip
Rewrite ephy node multiple removals to actually work.
2003-01-01 Marco Pesenti Gritti <marco@it.gnome.org> * 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.
Diffstat (limited to 'embed/ephy-history.c')
-rw-r--r--embed/ephy-history.c20
1 files changed, 12 insertions, 8 deletions
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;
}