aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-03-23 22:22:44 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-03-23 22:22:44 +0800
commitaba12c7f7872706afcbb05e7f089e17fef132d7a (patch)
tree3b8840dffe5125a4ada1754d52e0b578923b3a9f /e-util
parent7f4874e7ce21129029ce1e4eb0de5ef238c4ca31 (diff)
downloadgsoc2013-evolution-aba12c7f7872706afcbb05e7f089e17fef132d7a.tar
gsoc2013-evolution-aba12c7f7872706afcbb05e7f089e17fef132d7a.tar.gz
gsoc2013-evolution-aba12c7f7872706afcbb05e7f089e17fef132d7a.tar.bz2
gsoc2013-evolution-aba12c7f7872706afcbb05e7f089e17fef132d7a.tar.lz
gsoc2013-evolution-aba12c7f7872706afcbb05e7f089e17fef132d7a.tar.xz
gsoc2013-evolution-aba12c7f7872706afcbb05e7f089e17fef132d7a.tar.zst
gsoc2013-evolution-aba12c7f7872706afcbb05e7f089e17fef132d7a.zip
Bug 613639 - Evolution hard codes .gnome2
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-util.c27
-rw-r--r--e-util/e-util.h1
2 files changed, 27 insertions, 1 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 46404e6ed6..48f268994b 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -80,6 +80,31 @@ e_get_user_data_dir (void)
}
/**
+ * e_get_gnome2_user_dir:
+ *
+ * Returns the base directory for user data, according to libgnome.
+ * The directory can be overridden by setting the GNOME22_USER_DIR
+ * environment variable. The string is owned by Evolution and must
+ * not be modified or freed.
+ *
+ * Returns: base directory for GNOME user data
+ **/
+const gchar *
+e_get_gnome2_user_dir (void)
+{
+ static gchar *dirname = NULL;
+
+ if (G_UNLIKELY (dirname == NULL)) {
+ dirname = g_strdup (g_getenv ("GNOME22_USER_DIR"));
+ if (dirname == NULL)
+ dirname = g_build_filename (
+ g_get_home_dir (), ".gnome2", NULL);
+ }
+
+ return dirname;
+}
+
+/**
* e_get_accels_filename:
*
* Returns the name of the user data file containing custom keyboard
@@ -99,7 +124,7 @@ e_get_accels_filename (void)
if (G_UNLIKELY (filename == NULL))
filename = g_build_filename (
- g_get_home_dir (), ".gnome2",
+ e_get_gnome2_user_dir (),
"accels", PACKAGE, NULL);
return filename;
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 887cc20ce2..7d58a8a9d8 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -49,6 +49,7 @@ typedef enum {
typedef void (*ETypeFunc) (GType type, gpointer user_data);
const gchar * e_get_user_data_dir (void);
+const gchar * e_get_gnome2_user_dir (void);
const gchar * e_get_accels_filename (void);
void e_show_uri (GtkWindow *parent,
const gchar *uri);