[gnome-commander/gcmd-1-10: 1/8] Rename connections file to conections.deprecated



commit 3216486bc2faae691371e01bcefea1ab0ea9e8e1
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Fri Apr 12 22:38:11 2019 +0200

    Rename connections file to conections.deprecated

 src/gnome-cmd-data.cc | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 24ef0dba..e7d72384 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -3689,6 +3689,18 @@ void GnomeCmdData::load()
 
     g_autofree gchar *xml_cfg_path = config_dir ? g_build_filename (config_dir, PACKAGE ".xml", nullptr) : 
g_build_filename (get_package_config_dir(), PACKAGE ".xml", nullptr);
 
+    // ToDo: Remove the check for connections file in gcmd version > 1.10.1
+    // Move connections to connections.deprecated
+    g_autofree gchar *connections_path_old = g_build_filename (get_package_config_dir(), "connections", 
nullptr);
+    ifstream f(connections_path_old);
+
+    // If connections file does exist - rename it so that the user know it can be removed
+    if(!f.fail())
+    {
+        g_autofree gchar *connections_path_new = g_build_filename (get_package_config_dir(), 
"connections.deprecated", nullptr);
+        rename (connections_path_old, connections_path_new);
+    }
+
     // ToDo: Remove the check for xml cfg file in gcmd version >= 1.10.0
     if (gnome_cmd_xml_config_load (xml_cfg_path, *this))
     {


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