[evolution-data-server] Bug 613639 - Evolution hard codes .gnome2



commit 46a484f0c199b190596cfbe019a1a1ec31eb5bc4
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Mar 23 11:47:16 2010 -0400

    Bug 613639 - Evolution hard codes .gnome2

 libedataserverui/e-passwords.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index e675284..505b687 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -41,6 +41,8 @@
 #include "config.h"
 #endif
 
+#include <limits.h>
+#include <stdlib.h>
 #include <string.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n-lib.h>
@@ -110,11 +112,25 @@ check_key_file (const gchar *funcname)
 static gchar *
 ep_key_file_get_filename (void)
 {
+	const gchar *override;
+
 	/* XXX It would be nice to someday move this data elsewhere, or else
 	 * fully migrate to GNOME Keyring or whatever software supercedes it.
 	 * Evolution is one of the few remaining GNOME-2 applications that
 	 * still uses the deprecated ~/.gnome2_private directory. */
 
+	override = g_getenv ("GNOME22_USER_DIR");
+	if (override != NULL) {
+		gchar resolved_path[PATH_MAX];
+
+		/* Use realpath() to canonicalize the path, which
+		 * strips off any trailing directory separators so
+		 * we can safely tack on "_private". */
+		return g_strdup_printf (
+			"%s_private" G_DIR_SEPARATOR_S "Evolution",
+			realpath (override, resolved_path));
+	}
+
 	return g_build_filename (
 		g_get_home_dir (), ".gnome2_private", "Evolution", NULL);
 }



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