Index: lib/ephy-node.h =================================================================== RCS file: /cvs/gnome/epiphany/lib/ephy-node.h,v retrieving revision 1.21 diff -p -u -u -p -r1.21 ephy-node.h --- lib/ephy-node.h 16 Jan 2005 21:17:54 -0000 1.21 +++ lib/ephy-node.h 3 Apr 2005 16:04:45 -0000 @@ -47,6 +47,7 @@ typedef enum #include "ephy-node-db.h" typedef void (*EphyNodeCallback) (EphyNode *node, ...); +typedef gboolean (*EphyNodeFilterFunc) (EphyNodeDb *, EphyNode *, gpointer); GType ephy_node_get_type (void) G_GNUC_CONST; Index: lib/ephy-node-db.c =================================================================== RCS file: /cvs/gnome/epiphany/lib/ephy-node-db.c,v retrieving revision 1.21 diff -p -u -u -p -r1.21 ephy-node-db.c --- lib/ephy-node-db.c 28 Jan 2005 22:24:03 -0000 1.21 +++ lib/ephy-node-db.c 3 Apr 2005 16:04:46 -0000 @@ -504,32 +504,27 @@ ephy_node_db_write_to_xml_valist (EphyNo while (node != NULL) { GPtrArray *children; - guint n_exceptions, i; - GSList *exceptions = NULL; + EphyNodeFilterFunc filter; + gpointer user_data; + int i; - n_exceptions = va_arg (argptr, guint); - for (i=0; i < n_exceptions; i++) - { - exceptions = g_slist_prepend (exceptions, - va_arg (argptr, EphyNode *)); - } + filter = va_arg (argptr, EphyNodeFilterFunc); + user_data = va_arg (argptr, gpointer); children = ephy_node_get_children (node); - for (i=0; i < children->len; i++) + for (i = 0; i < children->len; i++) { EphyNode *kid; kid = g_ptr_array_index (children, i); - if (g_slist_find (exceptions, kid) == NULL) + if (!filter || filter (db, kid, user_data)) { ret = ephy_node_write_to_xml (kid, writer); if (ret < 0) break; } } if (ret < 0) break; - - g_slist_free (exceptions); node = va_arg (argptr, EphyNode *); } Index: lib/ephy-state.c =================================================================== RCS file: /cvs/gnome/epiphany/lib/ephy-state.c,v retrieving revision 1.34 diff -p -u -u -p -r1.34 ephy-state.c --- lib/ephy-state.c 7 Jan 2005 14:15:34 -0000 1.34 +++ lib/ephy-state.c 3 Apr 2005 16:04:46 -0000 @@ -67,7 +67,7 @@ ephy_states_save (void) EPHY_STATES_XML_ROOT, EPHY_STATES_XML_VERSION, NULL, /* comment */ - states, 0, + states, NULL, NULL, NULL); g_free (xml_file); Index: embed/ephy-history.c =================================================================== RCS file: /cvs/gnome/epiphany/embed/ephy-history.c,v retrieving revision 1.56 diff -p -u -u -p -r1.56 ephy-history.c --- embed/ephy-history.c 30 Jan 2005 20:09:58 -0000 1.56 +++ embed/ephy-history.c 3 Apr 2005 16:04:46 -0000 @@ -256,6 +256,14 @@ remove_obsolete_pages (EphyHistory *eb) } } +static gboolean +save_filter (EphyNodeDb *db, + EphyNode *node, + EphyNode *page_node) +{ + return node != page_node; +} + static void ephy_history_save (EphyHistory *eb) { @@ -275,8 +283,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) Index: embed/ephy-favicon-cache.c =================================================================== RCS file: /cvs/gnome/epiphany/embed/ephy-favicon-cache.c,v retrieving revision 1.42 diff -p -u -u -p -r1.42 ephy-favicon-cache.c --- embed/ephy-favicon-cache.c 27 Feb 2005 13:14:39 -0000 1.42 +++ embed/ephy-favicon-cache.c 3 Apr 2005 16:04:46 -0000 @@ -291,7 +291,8 @@ ephy_favicon_cache_finalize (GObject *ob 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); Index: src/bookmarks/ephy-bookmarks.c =================================================================== RCS file: /cvs/gnome/epiphany/src/bookmarks/ephy-bookmarks.c,v retrieving revision 1.103 diff -p -u -u -p -r1.103 ephy-bookmarks.c --- src/bookmarks/ephy-bookmarks.c 1 Feb 2005 23:42:48 -0000 1.103 +++ src/bookmarks/ephy-bookmarks.c 3 Apr 2005 16:04:47 -0000 @@ -309,6 +309,18 @@ ephy_bookmarks_class_init (EphyBookmarks g_type_class_add_private (object_class, sizeof(EphyBookmarksPrivate)); } +static gboolean +save_filter (EphyNodeDb *db, + EphyNode *node, + EphyBookmarks *bookmarks) +{ + EphyBookmarksPrivate *priv = bookmarks->priv; + + return node != priv->bookmarks && + node != priv->favorites && + node != priv->notcategorized; +} + static void ephy_bookmarks_save (EphyBookmarks *eb) { @@ -321,10 +333,8 @@ ephy_bookmarks_save (EphyBookmarks *eb) (xmlChar *) EPHY_BOOKMARKS_XML_ROOT, (xmlChar *) EPHY_BOOKMARKS_XML_VERSION, (xmlChar *) "Do not rely on this file, it's only for internal use. Use bookmarks.rdf instead.", - eb->priv->keywords, - 3, eb->priv->bookmarks, eb->priv->favorites, eb->priv->notcategorized, - eb->priv->bookmarks, - 0, + eb->priv->keywords, (EphyNodeFilterFunc) save_filter, eb, + eb->priv->bookmarks, NULL, NULL, NULL); /* Export bookmarks in rdf */