[gnome-commander] Adjust the remaining path variables to point to the new config location
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] Adjust the remaining path variables to point to the new config location
- Date: Mon, 4 Mar 2019 20:49:03 +0000 (UTC)
commit 887faf0460fa649a5d813e181734cde0f2996ae8
Author: Uwe Scholz <u scholz83 gmx de>
Date: Mon Mar 4 21:48:35 2019 +0100
Adjust the remaining path variables to point to the new config location
src/gnome-cmd-data.cc | 14 +++++++-------
src/gnome-cmd-file-popmenu.cc | 2 +-
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/gnome-cmd-data.cc b/src/gnome-cmd-data.cc
index 5204765e..c33af4db 100644
--- a/src/gnome-cmd-data.cc
+++ b/src/gnome-cmd-data.cc
@@ -2028,7 +2028,7 @@ static void save_devices_old (const gchar *fname)
GList *devices;
gchar *path = config_dir ?
g_build_filename (config_dir, fname, NULL) :
- g_build_filename (g_get_home_dir (), "." PACKAGE, fname, NULL);
+ g_build_filename (get_package_config_dir(), fname, NULL);
GKeyFile *key_file;
key_file = g_key_file_new ();
@@ -2083,7 +2083,7 @@ static void save_fav_apps_old (const gchar *fname)
{
gchar *path = config_dir ?
g_build_filename (config_dir, fname, NULL) :
- g_build_filename (g_get_home_dir (), "." PACKAGE, fname, NULL);
+ g_build_filename (get_package_config_dir(), fname, NULL);
GKeyFile *key_file;
key_file = g_key_file_new ();
@@ -2359,7 +2359,7 @@ static gboolean load_devices (const gchar *fname)
{
gchar *path = config_dir ?
g_build_filename (config_dir, fname, NULL) :
- g_build_filename (g_get_home_dir (), "." PACKAGE, fname, NULL);
+ g_build_filename (get_package_config_dir(), fname, NULL);
ifstream f(path);
@@ -2638,7 +2638,7 @@ static gboolean load_fav_apps_old (const gchar *fname)
GKeyFile *keyfile;
gchar *path = config_dir ?
g_build_filename (config_dir, fname, NULL) :
- g_build_filename (g_get_home_dir (), "." PACKAGE, fname, NULL);
+ g_build_filename (get_package_config_dir(), fname, NULL);
gnome_cmd_data.options.fav_apps = NULL;
@@ -3710,7 +3710,7 @@ void GnomeCmdData::load()
else // This is done for migration to gSettings. Can be deleted in gcmd 1.10.
save_devices_via_gsettings();
- g_autofree 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);
+ g_autofree gchar *xml_cfg_path = config_dir ? g_build_filename (config_dir, PACKAGE ".xml", NULL) :
g_build_filename (get_package_config_dir(), PACKAGE ".xml", NULL);
// ToDo: Remove the check for xml cfg file in gcmd version >= 1.10.0
if (gnome_cmd_xml_config_load (xml_cfg_path, *this))
@@ -3725,8 +3725,8 @@ void GnomeCmdData::load()
save_directory_history();
// Move gnome-commander.xml to gnome-commander.xml.deprecated
- g_autofree gchar *xml_cfg_path_old = config_dir ? g_build_filename (config_dir, PACKAGE ".xml",
NULL) : g_build_filename (g_get_home_dir (), "." PACKAGE, PACKAGE ".xml", NULL);
- g_autofree gchar *xml_cfg_path_new = config_dir ? g_build_filename (config_dir, PACKAGE ".xml",
NULL) : g_build_filename (g_get_home_dir (), "." PACKAGE, PACKAGE ".xml.deprecated", NULL);
+ g_autofree gchar *xml_cfg_path_old = config_dir ? g_build_filename (config_dir, PACKAGE ".xml",
NULL) : g_build_filename (get_package_config_dir(), PACKAGE ".xml", NULL);
+ g_autofree gchar *xml_cfg_path_new = config_dir ? g_build_filename (config_dir, PACKAGE ".xml",
NULL) : g_build_filename (get_package_config_dir(), PACKAGE ".xml.deprecated", NULL);
auto rv = rename (xml_cfg_path_old, xml_cfg_path_new);
if (rv == -1)
diff --git a/src/gnome-cmd-file-popmenu.cc b/src/gnome-cmd-file-popmenu.cc
index 5522511f..8557bc5e 100644
--- a/src/gnome-cmd-file-popmenu.cc
+++ b/src/gnome-cmd-file-popmenu.cc
@@ -735,7 +735,7 @@ GtkWidget *gnome_cmd_file_popmenu_new (GnomeCmdFileList *fl)
gnome_app_fill_menu (GTK_MENU_SHELL (menu), sep_uiinfo, NULL, FALSE, pos++);
// Script actions
- gchar *user_dir = g_build_filename (g_get_home_dir (), "." PACKAGE "/scripts", NULL);
+ gchar *user_dir = g_build_filename (g_get_user_config_dir (), "." PACKAGE "/scripts", NULL);
DIR *dp = opendir (user_dir);
GList *script_list = NULL;
if (dp != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]