[gnome-commander] GnomeCmdData: load_connections() only if no <Connections> found in xml cfg
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] GnomeCmdData: load_connections() only if no <Connections> found in xml cfg
- Date: Sun, 4 Sep 2011 21:11:27 +0000 (UTC)
commit 975e605c61438ed83f162e2137dc7f398578f6f7
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Sun Sep 4 23:01:22 2011 +0200
GnomeCmdData: load_connections() only if no <Connections> found in xml cfg
src/gnome-cmd-data.cc | 30 +++++++++++++++++-------------
src/gnome-cmd-data.h | 1 +
2 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 73e01f4..24ed5de 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -871,6 +871,7 @@ GnomeCmdData::GnomeCmdData(): search_defaults(selections)
{
quick_connect = NULL;
+ XML_cfg_has_connections = FALSE;
XML_cfg_has_bookmarks = FALSE;
confirm_delete = TRUE;
@@ -1237,19 +1238,6 @@ void GnomeCmdData::load()
priv->ftp_anonymous_password = gnome_cmd_data_get_string ("/ftp/anonymous_password", "you provider com");
}
- priv->con_list = gnome_cmd_con_list_new ();
-
- gnome_cmd_con_list_begin_update (priv->con_list);
- load_devices ("devices");
- load_connections ("connections");
- gnome_cmd_con_list_end_update (priv->con_list);
-
- // "/quick-connect/uri" must be read AFTER retrieving anonymous password
-
- gchar * quick_connect_uri = gnome_cmd_data_get_string ("/quick-connect/uri", "ftp://anonymous ftp gnome org/pub/GNOME/");
- quick_connect = gnome_cmd_con_ftp_new (NULL, quick_connect_uri);
- g_free (quick_connect_uri);
-
static struct
{
guint code;
@@ -1453,6 +1441,11 @@ void GnomeCmdData::load()
load_cmdline_history();
//load_dir_history ();
+ priv->con_list = gnome_cmd_con_list_new ();
+
+ gnome_cmd_con_list_begin_update (priv->con_list);
+ load_devices ("devices");
+
if (!gnome_cmd_xml_config_load (xml_cfg_path, *this))
{
load_rename_history();
@@ -1482,6 +1475,17 @@ void GnomeCmdData::load()
load_search_defaults();
}
+ if (!XML_cfg_has_connections)
+ load_connections ("connections");
+
+ gnome_cmd_con_list_end_update (priv->con_list);
+
+ // "/quick-connect/uri" must be read AFTER retrieving anonymous password
+
+ gchar * quick_connect_uri = gnome_cmd_data_get_string ("/quick-connect/uri", "ftp://anonymous ftp gnome org/pub/GNOME/");
+ quick_connect = gnome_cmd_con_ftp_new (NULL, quick_connect_uri);
+ g_free (quick_connect_uri);
+
// if number of registered user actions does not exceed 10 (nothing has been read), try to read old cfg file
if (gcmd_user_actions.size()<10)
gcmd_user_actions.load("key-bindings");
diff --git a/src/gnome-cmd-data.h b/src/gnome-cmd-data.h
index 0c58327..84b58ce 100644
--- a/src/gnome-cmd-data.h
+++ b/src/gnome-cmd-data.h
@@ -194,6 +194,7 @@ struct GnomeCmdData
public:
+ gboolean XML_cfg_has_connections;
gboolean XML_cfg_has_bookmarks;
gboolean confirm_delete;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]