[gnome-commander/get_rid_of_xml] Remove possibility of saving config to xml file
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/get_rid_of_xml] Remove possibility of saving config to xml file
- Date: Sun, 27 Jan 2019 15:51:26 +0000 (UTC)
commit 2d97c445dab3b791bc555962ac1e6022c5307bb4
Author: Uwe Scholz <u scholz83 gmx de>
Date: Sun Jan 27 16:42:00 2019 +0100
Remove possibility of saving config to xml file
src/gnome-cmd-con.cc | 15 -----
src/gnome-cmd-con.h | 2 -
src/gnome-cmd-data.cc | 132 -----------------------------------------
src/gnome-cmd-data.h | 8 ---
src/gnome-cmd-file-list.cc | 6 --
src/gnome-cmd-file-list.h | 2 -
src/gnome-cmd-file-selector.cc | 36 -----------
src/gnome-cmd-file-selector.h | 1 -
src/gnome-cmd-main-win.cc | 13 ----
src/gnome-cmd-main-win.h | 2 -
src/gnome-cmd-user-actions.cc | 34 -----------
src/gnome-cmd-user-actions.h | 2 -
12 files changed, 253 deletions(-)
---
diff --git a/src/gnome-cmd-con.cc b/src/gnome-cmd-con.cc
index 7872b491..8ae3df09 100644
--- a/src/gnome-cmd-con.cc
+++ b/src/gnome-cmd-con.cc
@@ -600,18 +600,3 @@ std::string &gnome_cmd_con_make_smb_uri (std::string &s, gboolean use_auth, std:
return s;
}
#endif
-
-
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdCon &con)
-{
- if (!con.alias || !*con.alias || !con.uri || !*con.uri)
- return xml;
-
- xml << XML::tag("Connection");
-
- xml << XML::attr("name") << XML::escape(con.alias);
- xml << XML::attr("uri") << XML::escape(con.uri);
- xml << XML::attr("auth") << con.auth;
-
- return xml << XML::endtag();
-}
diff --git a/src/gnome-cmd-con.h b/src/gnome-cmd-con.h
index 84a7b49d..74611d2f 100644
--- a/src/gnome-cmd-con.h
+++ b/src/gnome-cmd-con.h
@@ -114,8 +114,6 @@ struct GnomeCmdCon
gchar *open_failed_msg;
GnomeCmdConPrivate *priv;
-
- friend XML::xstream &operator << (XML::xstream &xml, GnomeCmdCon &con);
};
struct GnomeCmdConClass
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index be78839b..a596b833 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -1558,37 +1558,6 @@ inline gboolean GnomeCmdData::get_bool (const gchar *path, gboolean def)
}
-inline XML::xstream &operator << (XML::xstream &xml, GnomeCmdBookmark &bookmark)
-{
- xml << XML::tag("Bookmark") << XML::attr("name") << XML::escape(bookmark.name);
- xml << XML::attr("path") << XML::escape(bookmark.path) << XML::endtag();
-
- return xml;
-}
-
-
-static void write(XML::xstream &xml, GnomeCmdCon *con, const gchar *name)
-{
- if (!con)
- return;
-
- GList *bookmarks = gnome_cmd_con_get_bookmarks (con)->bookmarks;
-
- if (!bookmarks)
- return;
-
- xml << XML::tag("Group") << XML::attr("name") << name;
-
- if (GNOME_CMD_IS_CON_REMOTE (con))
- xml << XML::attr("remote") << TRUE;
-
- for (GList *i=bookmarks; i; i=i->next)
- xml << *(GnomeCmdBookmark *) i->data;
-
- xml << XML::endtag("Group");
-}
-
-
void GnomeCmdData::save_bookmarks()
{
gboolean hasBookmarks = false;
@@ -3884,45 +3853,6 @@ gint GnomeCmdData::migrate_data_int_value_into_gsettings(int user_value, GSettin
#pragma GCC diagnostic pop
#endif
-void GnomeCmdData::save_xml ()
-{
- gchar *xml_cfg_path = config_dir ? g_build_filename (config_dir, PACKAGE ".xml", NULL) :
g_build_filename (g_get_home_dir (), "." PACKAGE, PACKAGE ".xml", NULL);
-
- ofstream f(xml_cfg_path);
- XML::xstream xml(f);
-
- xml << *main_win;
-
- xml << search_defaults;
- xml << bookmarks_defaults;
-
- xml << XML::tag("Bookmarks");
-
- write (xml, priv->con_list->get_home(), "Home");
-#ifdef HAVE_SAMBA
- write (xml, priv->con_list->get_smb(), "SMB");
-#endif
- for (GList *i=gnome_cmd_con_list_get_all_remote (gnome_cmd_data.priv->con_list); i; i=i->next)
- {
- GnomeCmdCon *con = GNOME_CMD_CON (i->data);
- write (xml, con, XML::escape(gnome_cmd_con_get_alias (con)));
- }
-
- xml << XML::endtag("Bookmarks");
-
- xml << XML::tag("Selections");
- for (vector<SearchProfile>::iterator i=profiles.begin(); i!=profiles.end(); ++i)
- xml << *i;
- xml << XML::endtag("Selections");
-
- xml << gcmd_user_actions;
-
- xml << XML::endtag("GnomeCommander");
-
- g_free (xml_cfg_path);
-}
-
-
/**
* This method sets the value of a given GSettings key to the string stored in user_value or to the default
value,
* depending on the value of user_value. If the class of the key is not a string but a string array, the
first
@@ -4436,65 +4366,3 @@ const gchar *gnome_cmd_data_get_symlink_prefix ()
symlink_prefix = g_settings_get_string (gnome_cmd_data.options.gcmd_settings->general,
GCMD_SETTINGS_SYMLINK_PREFIX);
return (strlen(symlink_prefix) > 0) ? symlink_prefix : _("link to %s");
}
-
-
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdData::SearchProfile &cfg)
-{
- xml << XML::tag("Profile") << XML::attr("name") << XML::escape(cfg.name);
-
- xml << XML::tag("Pattern") << XML::attr("syntax") << (cfg.syntax==Filter::TYPE_REGEX ? "regex" :
"shell")
- << XML::attr("match-case") << 0 << XML::chardata();
-
- if (!strcmp("Default", cfg.name.c_str()) && gnome_cmd_data.options.save_search_history_on_exit)
- xml << XML::escape(cfg.filename_pattern);
- else
- xml << "";
-
- xml << XML::endtag();
-
- xml << XML::tag("Subdirectories") << XML::attr("max-depth") << cfg.max_depth << XML::endtag();
- xml << XML::tag("Text") << XML::attr("content-search") << cfg.content_search <<
XML::attr("match-case") << cfg.match_case << XML::chardata() << XML::escape(cfg.text_pattern) <<
XML::endtag();
-
- xml << XML::endtag();
-
- return xml;
-}
-
-
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdData::SearchConfig &cfg)
-{
- xml << XML::tag("SearchTool");
-
- xml << XML::tag("WindowSize") << XML::attr("width") << cfg.width << XML::attr("height") <<
cfg.height << XML::endtag();
- xml << cfg.default_profile;
-
- if (gnome_cmd_data.options.save_search_history_on_exit)
- {
- xml << XML::tag("History");
-
- for (GList *i=cfg.name_patterns.ents; i; i=i->next)
- xml << XML::tag("Pattern") << XML::chardata() << XML::escape((const gchar *) i->data) <<
XML::endtag();
-
- for (GList *i=cfg.content_patterns.ents; i; i=i->next)
- xml << XML::tag("Text") << XML::chardata() << XML::escape((const gchar *) i->data) <<
XML::endtag();
-
- xml << XML::endtag();
- }
-
- xml << XML::endtag();
-
- return xml;
-}
-
-
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdData::BookmarksConfig &cfg)
-{
- xml << XML::tag("BookmarksTool");
-
- xml << XML::tag("WindowSize") << XML::attr("width") << cfg.width << XML::attr("height") <<
cfg.height << XML::endtag();
-
- xml << XML::endtag();
-
- return xml;
-}
-
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index df8e8dd7..0d4525ea 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -542,8 +542,6 @@ struct GnomeCmdData
const std::string &description() const { return filename_pattern; }
void reset();
-
- friend XML::xstream &operator << (XML::xstream &xml, SearchProfile &cfg);
};
struct SearchConfig
@@ -567,7 +565,6 @@ struct GnomeCmdData
default_profile.name = "Default";
}
- friend XML::xstream &operator << (XML::xstream &xml, SearchConfig &cfg);
~SearchConfig() {};
};
@@ -604,8 +601,6 @@ struct GnomeCmdData
AdvrenameConfig(): width(600), height(400), templates(ADVRENAME_HISTORY_SIZE) {}
~AdvrenameConfig() {}
-
- friend XML::xstream &operator << (XML::xstream &xml, AdvrenameConfig &cfg);
};
struct IntViewerConfig
@@ -623,8 +618,6 @@ struct GnomeCmdData
struct BookmarksConfig
{
gint width {400}, height {250};
-
- friend XML::xstream &operator << (XML::xstream &xml, BookmarksConfig &cfg);
};
typedef std::pair<std::string,triple<GnomeCmdFileList::ColumnID,GtkSortType,gboolean> > Tab;
@@ -728,7 +721,6 @@ struct GnomeCmdData
void save_search_profiles ();
void save_bookmarks();
void save();
- void save_xml ();
gint gnome_cmd_data_get_int (const gchar *path, int def);
gchar* gnome_cmd_data_get_string (const gchar *path, const gchar *def);
void gnome_cmd_data_set_string (const gchar *path, const gchar *value);
diff --git a/src/gnome-cmd-file-list.cc b/src/gnome-cmd-file-list.cc
index fecdb7b1..47b9d577 100644
--- a/src/gnome-cmd-file-list.cc
+++ b/src/gnome-cmd-file-list.cc
@@ -3192,9 +3192,3 @@ void GnomeCmdFileList::drop_files(GnomeVFSXferOptions xferOptions, GList *uri_li
GTK_SIGNAL_FUNC (unref_uri_list),
uri_list);
}
-
-
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdFileList &fl)
-{
- return xml << XML::tag("Tab") << XML::attr("path") << XML::escape((const char*) GNOME_CMD_FILE
(fl.cwd)->get_real_path()) << XML::attr("sort") << fl.get_sort_column() << XML::attr("asc") <<
fl.get_sort_order() << XML::attr("lock") << fl.locked << XML::endtag();
-}
diff --git a/src/gnome-cmd-file-list.h b/src/gnome-cmd-file-list.h
index b8fb2a1a..44e853d6 100644
--- a/src/gnome-cmd-file-list.h
+++ b/src/gnome-cmd-file-list.h
@@ -217,8 +217,6 @@ struct GnomeCmdFileList
void init_dnd();
void drop_files(GnomeVFSXferOptions xferOptions, GList *uri_list, GnomeCmdDir *dir);
-
- friend XML::xstream &operator << (XML::xstream &xml, GnomeCmdFileList &fl);
};
diff --git a/src/gnome-cmd-file-selector.cc b/src/gnome-cmd-file-selector.cc
index ecafb6c2..94b1a896 100644
--- a/src/gnome-cmd-file-selector.cc
+++ b/src/gnome-cmd-file-selector.cc
@@ -1599,42 +1599,6 @@ void GnomeCmdFileSelector::update_tab_label(GnomeCmdFileList *fl)
}
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdFileSelector &fs)
-{
- GList *tabs = gtk_container_get_children (*fs.notebook);
-
- if (gnome_cmd_data.options.save_tabs_on_exit)
- for (GList *i=tabs; i; i=i->next)
- {
- GnomeCmdFileList *fl = (GnomeCmdFileList *) gtk_bin_get_child (GTK_BIN (i->data));
-
- if (GNOME_CMD_FILE_LIST (fl) && gnome_cmd_con_is_local (fl->con))
- xml << *fl;
- }
- else
- if (gnome_cmd_data.options.save_dirs_on_exit)
- for (GList *i=tabs; i; i=i->next)
- {
- GnomeCmdFileList *fl = (GnomeCmdFileList *) gtk_bin_get_child (GTK_BIN (i->data));
-
- if (GNOME_CMD_FILE_LIST (fl) && gnome_cmd_con_is_local (fl->con) && (fl==fs.file_list() ||
fl->locked))
- xml << *fl;
- }
- else
- for (GList *i=tabs; i; i=i->next)
- {
- GnomeCmdFileList *fl = (GnomeCmdFileList *) gtk_bin_get_child (GTK_BIN (i->data));
-
- if (GNOME_CMD_FILE_LIST (fl) && gnome_cmd_con_is_local (fl->con) && fl->locked)
- xml << *fl;
- }
-
- g_list_free (tabs);
-
- return xml;
-}
-
-
GList* GnomeCmdFileSelector::GetTabs()
{
GList *tabs = gtk_container_get_children (*this->notebook);
diff --git a/src/gnome-cmd-file-selector.h b/src/gnome-cmd-file-selector.h
index 254cd713..9f175bdd 100644
--- a/src/gnome-cmd-file-selector.h
+++ b/src/gnome-cmd-file-selector.h
@@ -110,7 +110,6 @@ struct GnomeCmdFileSelector
gboolean key_pressed(GdkEventKey *event);
- friend XML::xstream &operator << (XML::xstream &xml, GnomeCmdFileSelector &fs);
GList* GetTabs();
};
diff --git a/src/gnome-cmd-main-win.cc b/src/gnome-cmd-main-win.cc
index ed3b07ac..bda83c18 100644
--- a/src/gnome-cmd-main-win.cc
+++ b/src/gnome-cmd-main-win.cc
@@ -1425,16 +1425,3 @@ void GnomeCmdMainWin::maximize_pane()
else
slide_set_0_100 (NULL, NULL);
}
-
-
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdMainWin &mw)
-{
- xml << XML::tag("Layout");
-
- xml << XML::tag("Panel") << XML::attr("name") << "left" << *mw.fs(LEFT) << XML::endtag();
- xml << XML::tag("Panel") << XML::attr("name") << "right" << *mw.fs(RIGHT) << XML::endtag();
-
- xml << XML::endtag();
-
- return xml;
-}
diff --git a/src/gnome-cmd-main-win.h b/src/gnome-cmd-main-win.h
index 54f883e0..8d422249 100644
--- a/src/gnome-cmd-main-win.h
+++ b/src/gnome-cmd-main-win.h
@@ -98,8 +98,6 @@ struct GnomeCmdMainWin
void update_mainmenu_visibility();
void add_plugin_menu(PluginData *data);
-
- friend XML::xstream &operator << (XML::xstream &xml, GnomeCmdMainWin &mw);
};
extern GnomeCmdMainWin *main_win;
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 3aa35243..4722a6a2 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -566,40 +566,6 @@ gboolean GnomeCmdUserActions::handle_key_event(GnomeCmdMainWin *mw, GnomeCmdFile
return TRUE;
}
-XML::xstream &operator << (XML::xstream &xml, GnomeCmdUserActions &usr)
-{
- xml << XML::tag("KeyBindings");
- for (auto thisAction : usr.action)
- if (!ascii_isupper (thisAction.first)) // ignore lowercase keys as they duplicate uppercase ones
- {
- guint state = thisAction.first.state;
- guint key_val = thisAction.first.keyval;
-
- xml << XML::tag("Key") << XML::attr("name");
- if (ascii_isalnum (key_val))
- xml << (gchar) key_val;
- else
- xml << gdk_key_names[key_val];
-
- if (state & GDK_SHIFT_MASK) xml << XML::attr("shift") << 1;
- if (state & GDK_CONTROL_MASK) xml << XML::attr("control") << 1;
- if (state & GDK_MOD1_MASK) xml << XML::attr("alt") << 1;
- if (state & GDK_SUPER_MASK) xml << XML::attr("super") << 1;
- if (state & GDK_HYPER_MASK) xml << XML::attr("hyper") << 1;
- if (state & GDK_META_MASK) xml << XML::attr("meta") << 1;
-
- xml << XML::attr("action") << usr.action_func[thisAction.second.func];
- if (!thisAction.second.user_data.empty())
- xml << XML::attr("options") << XML::escape(thisAction.second.user_data);
-
- xml << XML::endtag();
- }
-
- xml << XML::endtag();
-
- return xml;
-}
-
static int sort_by_description (const void *data1, const void *data2)
{
diff --git a/src/gnome-cmd-user-actions.h b/src/gnome-cmd-user-actions.h
index 2d0445e0..66ddce85 100644
--- a/src/gnome-cmd-user-actions.h
+++ b/src/gnome-cmd-user-actions.h
@@ -196,8 +196,6 @@ class GnomeCmdUserActions
const gchar *name(const std::string &name_description) { return
action_func[action_name[name_description]].c_str(); }
const gchar *description(const_iterator &i) { return
action_name[i->second.func].c_str(); }
const gchar *options(const_iterator &i) { return
i->second.user_data.c_str(); }
-
- friend XML::xstream &operator << (XML::xstream &xml, GnomeCmdUserActions &usr);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]