[evolution-data-server] Bug #726681 - Check GConf XDG folder for migration too



commit e4efa871d0bd6d8f35a1e7343319f7fce663c76d
Author: Milan Crha <mcrha redhat com>
Date:   Wed Mar 19 11:26:37 2014 +0100

    Bug #726681 - Check GConf XDG folder for migration too

 .../evolution-source-registry-migrate-sources.c    |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/services/evolution-source-registry/evolution-source-registry-migrate-sources.c 
b/services/evolution-source-registry/evolution-source-registry-migrate-sources.c
index 49ff198..f9cf7ae 100644
--- a/services/evolution-source-registry/evolution-source-registry-migrate-sources.c
+++ b/services/evolution-source-registry/evolution-source-registry-migrate-sources.c
@@ -3767,10 +3767,16 @@ evolution_source_registry_migrate_sources (void)
        gchar *gconf_base_dir;
        gchar *gconf_tree_xml;
 
-       gconf_base_dir =
-               g_build_filename (g_get_home_dir (), ".gconf", NULL);
-       gconf_tree_xml =
-               g_build_filename (gconf_base_dir, "%gconf-tree.xml", NULL);
+       /* If the GConf is configured to follow XDG settings, then its root
+        * data folder is ~/.config/gconf/, thus try this first and fallback
+        * to the default non-XDG path ~/.gconf/ if it doesn't exist. */
+       gconf_base_dir = g_build_filename (g_get_user_config_dir (), "gconf", NULL);
+       if (!g_file_test (gconf_base_dir, G_FILE_TEST_EXISTS)) {
+               g_free (gconf_base_dir);
+               gconf_base_dir = g_build_filename (g_get_home_dir (), ".gconf", NULL);
+       }
+
+       gconf_tree_xml = g_build_filename (gconf_base_dir, "%gconf-tree.xml", NULL);
 
        /* Handle a merged GConf tree file if present (mainly for
         * Debian), otherwise assume a normal GConf directory tree. */


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