[gnome-commander/gcmd-1-3] XML config: create gnome-commander.xml file using XML::xstream



commit ca4a5a62b5300617e5726d3d93787cf9ec83070f
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Wed Sep 2 18:55:38 2009 +0200

    XML config: create gnome-commander.xml file using XML::xstream

 src/gnome-cmd-data.cc |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index e398faf..e598a70 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -23,6 +23,8 @@
 #include <libgnomevfs/gnome-vfs-volume-monitor.h>
 #include <libgnomevfs/gnome-vfs-volume.h>
 
+#include <fstream>
+
 #include "gnome-cmd-includes.h"
 #include "gnome-cmd-data.h"
 #include "gnome-cmd-file-selector.h"
@@ -1749,6 +1751,21 @@ void GnomeCmdData::save()
     save_fav_apps ("fav-apps");
     save_intviewer_defaults();
     gnome_cmd_xml_config_save (xml_cfg_path, *this);
+
+    {
+        gchar *xml_cfg_path = g_build_path (G_DIR_SEPARATOR_S, g_get_home_dir (), "." PACKAGE, PACKAGE ".xml", NULL);
+
+        ofstream f(xml_cfg_path);
+        XML::xstream xml(f);
+
+        xml << XML::comment("Created with GNOME Commander (http://www.nongnu.org/gcmd/)");
+        xml << XML::tag("GnomeCommander") << XML::attr("version") << VERSION;
+
+        xml << XML::endtag("GnomeCommander");
+
+        g_free (xml_cfg_path);
+    }
+
     save_local_bookmarks();
     save_smb_bookmarks();
     save_auto_load_plugins();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]