[gnome-commander] XML config: save search settings
- From: Piotr Eljasiak <epiotr src gnome org>
- To: svn-commits-list gnome org
- Subject: [gnome-commander] XML config: save search settings
- Date: Wed, 1 Jul 2009 22:18:10 +0000 (UTC)
commit be2c71d74f6e134a1a790dbb08c6698f3fb20c7b
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Thu Jul 2 00:14:32 2009 +0200
XML config: save search settings
src/gnome-cmd-data.h | 1 -
src/gnome-cmd-xml-config.cc | 28 ++++++++++++++++++++++++++++
2 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 68f67f0..70c45eb 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -160,7 +160,6 @@ struct GnomeCmdData
void save_auto_load_plugins();
void save_cmdline_history();
void save_local_bookmarks();
- void save_search_defaults();
void save_intviewer_defaults();
void save_smb_bookmarks();
diff --git a/src/gnome-cmd-xml-config.cc b/src/gnome-cmd-xml-config.cc
index 4dd2127..d428b2e 100644
--- a/src/gnome-cmd-xml-config.cc
+++ b/src/gnome-cmd-xml-config.cc
@@ -643,6 +643,34 @@ void gnome_cmd_xml_config_save (const gchar *path, GnomeCmdData &cfg)
fputs("\t\t</History>\n", f);
fputs("\t</AdvancedRenameTool>\n", f);
+
+ const gchar *val;
+
+ fputs("\t<SearchTool>\n", f);
+ fprintf (f, "\t\t<WindowSize width=\"%i\" height=\"%i\" />\n", cfg.search_defaults.width, cfg.search_defaults.height);
+ fputs("\t\t<Profile name=\"Default\">\n", f);
+ val = cfg.search_defaults.name_patterns.front();
+ fprintf_escaped (f, "\t\t\t<Pattern syntax=\"%s\" match-case=\"0\">%s</Pattern>\n", cfg.search_defaults.default_profile.syntax == Filter::TYPE_REGEX ? "regex" : "shell", val ? val : "");
+ fprintf (f, "\t\t\t<Path recursive=\"%i\" />\n", cfg.search_defaults.default_profile.recursive);
+ if (TRUE) // FIXME: if checked 'Find text'
+ {
+ val = cfg.search_defaults.content_patterns.front();
+ fprintf_escaped (f, "\t\t\t<Text match-case=\"%i\">%s</Text>\n", cfg.search_defaults.default_profile.match_case, val ? val : "");
+ }
+ fputs("\t\t</Profile>\n", f);
+ fputs("\t\t<History>\n", f);
+
+ for (GList *i=cfg.search_defaults.name_patterns.ents; i; i=i->next)
+ fprintf_escaped (f, "\t\t\t<Pattern>%s</Pattern>\n", (const gchar *) i->data);
+
+ for (GList *i=cfg.search_defaults.directories.ents; i; i=i->next)
+ fprintf_escaped (f, "\t\t\t<Path>%s</Path>\n", (const gchar *) i->data);
+
+ for (GList *i=cfg.search_defaults.content_patterns.ents; i; i=i->next)
+ fprintf_escaped (f, "\t\t\t<Text>%s</Text>\n", (const gchar *) i->data);
+
+ fputs("\t\t</History>\n", f);
+ fputs("\t</SearchTool>\n", f);
fputs("</GnomeCommander>\n", f);
fputs("", f);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]