diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2003-11-08 20:56:44 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2003-11-08 20:56:44 +0800 |
commit | 6b00de66025093218127fa74d9a423d58e377025 (patch) | |
tree | f2bee4a1f06f16128aa1a2e64da8023d882e1e58 /src/bookmarks/ephy-bookmarks.c | |
parent | 5e5d25f08036ef3f2ac9af3071a36def13f5b2c6 (diff) | |
download | gsoc2013-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 'src/bookmarks/ephy-bookmarks.c')
-rw-r--r-- | src/bookmarks/ephy-bookmarks.c | 59 |
1 files changed, 12 insertions, 47 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c index 020eab429..2caf08c05 100644 --- a/src/bookmarks/ephy-bookmarks.c +++ b/src/bookmarks/ephy-bookmarks.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 Marco Pesenti Gritti + * Copyright (C) 2002, 2003 Marco Pesenti Gritti * * 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 @@ -19,7 +19,7 @@ */ #ifdef HAVE_CONFIG_H -#include <config.h> +#include "config.h" #endif #include "ephy-bookmarks.h" @@ -249,54 +249,19 @@ ephy_bookmarks_class_init (EphyBookmarksClass *klass) static void ephy_bookmarks_save (EphyBookmarks *eb) { - xmlDocPtr doc; - xmlNodePtr root; - xmlNodePtr comment; - GPtrArray *children; - int i; LOG ("Saving bookmarks") - /* save nodes to xml */ - xmlIndentTreeOutput = TRUE; - doc = xmlNewDoc ("1.0"); - - root = xmlNewDocNode (doc, NULL, "ephy_bookmarks", NULL); - xmlSetProp (root, "version", EPHY_BOOKMARKS_XML_VERSION); - xmlDocSetRootElement (doc, root); - - comment = xmlNewDocComment (doc, "Do not rely on this file, it's only for internal use. Use bookmarks.rdf instead."); - xmlAddChild (root, comment); - - children = ephy_node_get_children (eb->priv->keywords); - for (i = 0; i < children->len; i++) - { - EphyNode *kid; - - kid = g_ptr_array_index (children, i); - - if (kid != eb->priv->bookmarks && - kid != eb->priv->favorites && - kid != eb->priv->notcategorized) - { - ephy_node_save_to_xml (kid, root); - } - } - ephy_node_thaw (eb->priv->keywords); - - children = ephy_node_get_children (eb->priv->bookmarks); - 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 (eb->priv->bookmarks); - - ephy_file_save_xml (eb->priv->xml_file, doc); - xmlFreeDoc(doc); + ephy_node_db_write_to_xml_safe + (eb->priv->db, eb->priv->xml_file, + EPHY_BOOKMARKS_XML_ROOT, + EPHY_BOOKMARKS_XML_VERSION, + "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, + NULL); /* Export bookmarks in rdf */ ephy_bookmarks_export_rdf (eb, eb->priv->rdf_file); |