From 30cfaa4a4929d85f303b3afc9c8ec240d548ff87 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Fri, 8 Apr 2005 13:26:25 +0000 Subject: Implement a more flexible approach at saving a EphyNodeDb, by allowing to 2005-04-08 Christian Persch * embed/ephy-favicon-cache.c: (ephy_favicon_cache_finalize): * embed/ephy-history.c: (save_filter), (ephy_history_save): * lib/ephy-node-db.c: (ephy_node_db_write_to_xml_valist): * lib/ephy-node.h: * lib/ephy-state.c: (ephy_states_save): * src/bookmarks/ephy-bookmarks.c: (save_filter), (ephy_bookmarks_save): Implement a more flexible approach at saving a EphyNodeDb, by allowing to specify a filter func to exclude certain nodes, instead of a fixed list. --- embed/ephy-favicon-cache.c | 3 ++- embed/ephy-history.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'embed') diff --git a/embed/ephy-favicon-cache.c b/embed/ephy-favicon-cache.c index 6d7269a48..0e283e229 100644 --- a/embed/ephy-favicon-cache.c +++ b/embed/ephy-favicon-cache.c @@ -291,7 +291,8 @@ ephy_favicon_cache_finalize (GObject *object) EPHY_FAVICON_CACHE_XML_ROOT, EPHY_FAVICON_CACHE_XML_VERSION, NULL, - cache->priv->icons, 0, NULL); + cache->priv->icons, NULL, NULL, + NULL); g_free (cache->priv->xml_file); g_free (cache->priv->directory); diff --git a/embed/ephy-history.c b/embed/ephy-history.c index 31873b51f..e6c8f08c9 100644 --- a/embed/ephy-history.c +++ b/embed/ephy-history.c @@ -256,6 +256,13 @@ remove_obsolete_pages (EphyHistory *eb) } } +static gboolean +save_filter (EphyNode *node, + EphyNode *page_node) +{ + return node != page_node; +} + static void ephy_history_save (EphyHistory *eb) { @@ -275,8 +282,8 @@ ephy_history_save (EphyHistory *eb) EPHY_HISTORY_XML_VERSION, NULL, /* comment */ eb->priv->hosts, - 1, eb->priv->pages, - eb->priv->pages, 0, + (EphyNodeFilterFunc) save_filter, eb->priv->pages, + eb->priv->pages, NULL, NULL, NULL); if (ret >=0) -- cgit v1.2.3