Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-04-25 14:24:17 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-04-25 14:24:17 (GMT)
commitd578d4048cd4cb85bcb3f84a30e552ddd1709bd3 (patch)
treeb07f42de4a77db46840bd54c53cf3b09394483bc /shell
parent3681c78c7db4e2b02feb370bbff5275c64f430b7 (diff)
Respect GNOME22_USER_DIR env variable
Based on patch by Ray Strode. Fixes bug #613637.
Diffstat (limited to 'shell')
-rw-r--r--shell/ev-application.c37
1 files changed, 27 insertions, 10 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c
index 0719ded..497ce21 100644
--- a/shell/ev-application.c
+++ b/shell/ev-application.c
@@ -94,6 +94,8 @@ G_DEFINE_TYPE (EvApplication, ev_application, G_TYPE_OBJECT);
#define APPLICATION_DBUS_INTERFACE "org.gnome.evince.Application"
#endif
+static const gchar *userdir = NULL;
+
/**
* ev_application_get_instance:
*
@@ -813,9 +815,14 @@ ev_application_accel_map_save (EvApplication *application)
gchar *tmp_filename;
gint fd;
- accel_map_file = g_build_filename (g_get_home_dir (),
- ".gnome2", "accels",
- "evince", NULL);
+ if (userdir) {
+ accel_map_file = g_build_filename (userdir, "accels",
+ "evince", NULL);
+ } else {
+ accel_map_file = g_build_filename (g_get_home_dir (),
+ ".gnome2", "accels",
+ "evince", NULL);
+ }
tmp_filename = g_strdup_printf ("%s.XXXXXX", accel_map_file);
@@ -843,9 +850,15 @@ ev_application_accel_map_load (EvApplication *application)
{
gchar *accel_map_file;
- accel_map_file = g_build_filename (g_get_home_dir (),
- ".gnome2", "accels",
- "evince", NULL);
+ if (userdir) {
+ accel_map_file = g_build_filename (userdir, "accels",
+ "evince", NULL);
+ } else {
+ accel_map_file = g_build_filename (g_get_home_dir (),
+ ".gnome2", "accels",
+ "evince", NULL);
+ }
+
gtk_accel_map_load (accel_map_file);
g_free (accel_map_file);
}
@@ -903,10 +916,14 @@ ev_application_init (EvApplication *ev_application)
{
GError *error = NULL;
- ev_application->dot_dir = g_build_filename (g_get_home_dir (),
- ".gnome2",
- "evince",
- NULL);
+ userdir = g_getenv ("GNOME22_USER_DIR");
+ if (userdir)
+ ev_application->dot_dir = g_build_filename (userdir, "evince", NULL);
+ else
+ ev_application->dot_dir = g_build_filename (g_get_home_dir (),
+ ".gnome2",
+ "evince",
+ NULL);
#ifdef G_OS_WIN32
{