aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ephy-state.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-11-08 20:56:44 +0800
committerChristian Persch <chpe@src.gnome.org>2003-11-08 20:56:44 +0800
commit6b00de66025093218127fa74d9a423d58e377025 (patch)
treef2bee4a1f06f16128aa1a2e64da8023d882e1e58 /lib/ephy-state.c
parent5e5d25f08036ef3f2ac9af3071a36def13f5b2c6 (diff)
downloadgsoc2013-epiphany-6b00de66025093218127fa74d9a423d58e377025.tar
gsoc2013-epiphany-6b00de66025093218127fa74d9a423d58e377025.tar.gz
gsoc2013-epiphany-6b00de66025093218127fa74d9a423d58e377025.tar.bz2
gsoc2013-epiphany-6b00de66025093218127fa74d9a423d58e377025.tar.lz
gsoc2013-epiphany-6b00de66025093218127fa74d9a423d58e377025.tar.xz
gsoc2013-epiphany-6b00de66025093218127fa74d9a423d58e377025.tar.zst
gsoc2013-epiphany-6b00de66025093218127fa74d9a423d58e377025.zip
Port node db saving and RDF export to xml writer api.
2003-11-08 Christian Persch <chpe@cvs.gnome.org> * embed/ephy-favicon-cache.c: (ephy_favicon_cache_get_type), (ephy_favicon_cache_finalize): * embed/ephy-history.c: (ephy_history_save): * lib/ephy-file-helpers.c: (ephy_file_switch_temp_file): * lib/ephy-file-helpers.h: * lib/ephy-node-db.c: (ephy_node_db_load_from_file), (ephy_node_db_write_to_xml_valist), (ephy_node_db_write_to_xml_safe): * lib/ephy-node-db.h: * lib/ephy-node.c: (write_parent), (ephy_node_write_to_xml): * lib/ephy-node.h: * lib/ephy-state.c: (ephy_states_save), (ensure_states): * src/bookmarks/ephy-bookmarks-export.c: (write_topics_list), (ephy_bookmarks_export_rdf): * src/bookmarks/ephy-bookmarks.c: (ephy_bookmarks_save): Port node db saving and RDF export to xml writer api.
Diffstat (limited to 'lib/ephy-state.c')
-rw-r--r--lib/ephy-state.c44
1 files changed, 13 insertions, 31 deletions
diff --git a/lib/ephy-state.c b/lib/ephy-state.c
index c797d2211..33edb87a5 100644
--- a/lib/ephy-state.c
+++ b/lib/ephy-state.c
@@ -1,7 +1,7 @@
/*
* Copyright (C) 2001 Matthew Mueller
- * (C) 2002 Jorn Baayen <jorn@nl.linux.org>
- * (C) 2003 Marco Pesenti Gritti <mpeseng@tin.it>
+ * Copyright (C) 2002 Jorn Baayen <jorn@nl.linux.org>
+ * Copyright (C) 2003 Marco Pesenti Gritti <mpeseng@tin.it>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -28,7 +28,7 @@
#include <gtk/gtkwindow.h>
#include <gtk/gtkpaned.h>
-#define STATES_FILE "states.xml"
+#define EPHY_STATES_XML_FILE "states.xml"
#define EPHY_STATES_XML_ROOT "ephy_states"
#define EPHY_STATES_XML_VERSION "1.0"
@@ -50,39 +50,21 @@ static EphyNodeDb *states_db = NULL;
static void
ephy_states_save (void)
{
- xmlDocPtr doc;
- xmlNodePtr root;
- GPtrArray *children;
- int i;
char *xml_file;
- if (states == NULL) return;
-
xml_file = g_build_filename (ephy_dot_dir (),
- STATES_FILE,
+ EPHY_STATES_XML_FILE,
NULL);
- /* save nodes to xml */
- xmlIndentTreeOutput = TRUE;
- doc = xmlNewDoc ("1.0");
-
- root = xmlNewDocNode (doc, NULL, "ephy_states", NULL);
- xmlSetProp (root, "version", EPHY_STATES_XML_VERSION);
- xmlDocSetRootElement (doc, root);
-
- children = ephy_node_get_children (states);
- for (i = 0; i < children->len; i++)
- {
- EphyNode *kid;
-
- kid = g_ptr_array_index (children, i);
-
- ephy_node_save_to_xml (kid, root);
- }
- ephy_node_thaw (states);
+ ephy_node_db_write_to_xml_safe
+ (states_db, xml_file,
+ EPHY_STATES_XML_ROOT,
+ EPHY_STATES_XML_VERSION,
+ NULL, /* comment */
+ states, 0,
+ NULL);
- ephy_file_save_xml (xml_file, doc);
- g_free (xml_file);
+ g_free (xml_file);
}
static EphyNode *
@@ -120,7 +102,7 @@ ensure_states (void)
char *xml_file;
xml_file = g_build_filename (ephy_dot_dir (),
- STATES_FILE,
+ EPHY_STATES_XML_FILE,
NULL);
states_db = ephy_node_db_new (EPHY_NODE_DB_STATES);