aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-node-db.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-04-08 21:26:25 +0800
committerChristian Persch <chpe@src.gnome.org>2005-04-08 21:26:25 +0800
commit30cfaa4a4929d85f303b3afc9c8ec240d548ff87 (patch)
tree833970d4a40cf2aabd3fb62b87ca16e640c0523f /lib/ephy-node-db.c
parent3ddeef804136e9f47f66c38c80d126a4285d525d (diff)
downloadgsoc2013-epiphany-30cfaa4a4929d85f303b3afc9c8ec240d548ff87.tar
gsoc2013-epiphany-30cfaa4a4929d85f303b3afc9c8ec240d548ff87.tar.gz
gsoc2013-epiphany-30cfaa4a4929d85f303b3afc9c8ec240d548ff87.tar.bz2
gsoc2013-epiphany-30cfaa4a4929d85f303b3afc9c8ec240d548ff87.tar.lz
gsoc2013-epiphany-30cfaa4a4929d85f303b3afc9c8ec240d548ff87.tar.xz
gsoc2013-epiphany-30cfaa4a4929d85f303b3afc9c8ec240d548ff87.tar.zst
gsoc2013-epiphany-30cfaa4a4929d85f303b3afc9c8ec240d548ff87.zip
Implement a more flexible approach at saving a EphyNodeDb, by allowing to
2005-04-08 Christian Persch <chpe@cvs.gnome.org> * 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.
Diffstat (limited to 'lib/ephy-node-db.c')
-rw-r--r--lib/ephy-node-db.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/ephy-node-db.c b/lib/ephy-node-db.c
index 8f553491a..c98f7b4f7 100644
--- a/lib/ephy-node-db.c
+++ b/lib/ephy-node-db.c
@@ -504,24 +504,21 @@ ephy_node_db_write_to_xml_valist (EphyNodeDb *db,
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 (kid, user_data))
{
ret = ephy_node_write_to_xml (kid, writer);
if (ret < 0) break;
@@ -529,8 +526,6 @@ ephy_node_db_write_to_xml_valist (EphyNodeDb *db,
}
if (ret < 0) break;
- g_slist_free (exceptions);
-
node = va_arg (argptr, EphyNode *);
}
if (ret < 0) goto out;