diff options
author | Perberos <[email protected]> | 2011-11-09 20:19:23 -0300 |
---|---|---|
committer | Perberos <[email protected]> | 2011-11-09 20:19:23 -0300 |
commit | d8734b92b73d86bcef29d2324801b760e11b2644 (patch) | |
tree | 094bba128932691f8ccbe171953d09690d314de4 /shell/ev-application.c | |
parent | 980203e0f17d7622f3698f76903d93c4e641e886 (diff) | |
download | atril-d8734b92b73d86bcef29d2324801b760e11b2644.tar.bz2 atril-d8734b92b73d86bcef29d2324801b760e11b2644.tar.xz |
using ~/.config/ instead of ~/.mate2/
Diffstat (limited to 'shell/ev-application.c')
-rw-r--r-- | shell/ev-application.c | 99 |
1 files changed, 51 insertions, 48 deletions
diff --git a/shell/ev-application.c b/shell/ev-application.c index 697ab083..a5a67f22 100644 --- a/shell/ev-application.c +++ b/shell/ev-application.c @@ -850,59 +850,61 @@ ev_application_open_uri_list (EvApplication *application, } } -static void -ev_application_accel_map_save (EvApplication *application) +static void ev_application_accel_map_save(EvApplication* application) { - gchar *accel_map_file; - gchar *tmp_filename; - gint fd; + gchar* accel_map_file; + gchar* tmp_filename; + gint fd; - if (userdir) { - accel_map_file = g_build_filename (userdir, "accels", - "atril", NULL); - } else { - accel_map_file = g_build_filename (g_get_home_dir (), - ".mate2", "accels", - "atril", NULL); + if (userdir) + { + accel_map_file = g_build_filename(userdir, "accels", "atril", NULL); + } + else + { + accel_map_file = g_build_filename(g_get_home_dir(), ".config", "accels", "atril", NULL); } - tmp_filename = g_strdup_printf ("%s.XXXXXX", accel_map_file); + tmp_filename = g_strdup_printf("%s.XXXXXX", accel_map_file); - fd = g_mkstemp (tmp_filename); - if (fd == -1) { - g_free (accel_map_file); - g_free (tmp_filename); + fd = g_mkstemp(tmp_filename); + + if (fd == -1) + { + g_free(accel_map_file); + g_free(tmp_filename); return; } - gtk_accel_map_save_fd (fd); - close (fd); - if (g_rename (tmp_filename, accel_map_file) == -1) { + gtk_accel_map_save_fd(fd); + close(fd); + + if (g_rename(tmp_filename, accel_map_file) == -1) + { /* FIXME: win32? */ - g_unlink (tmp_filename); + g_unlink(tmp_filename); } - g_free (accel_map_file); - g_free (tmp_filename); + g_free(accel_map_file); + g_free(tmp_filename); } -static void -ev_application_accel_map_load (EvApplication *application) +static void ev_application_accel_map_load(EvApplication* application) { - gchar *accel_map_file; + gchar* accel_map_file; - if (userdir) { - accel_map_file = g_build_filename (userdir, "accels", - "atril", NULL); - } else { - accel_map_file = g_build_filename (g_get_home_dir (), - ".mate2", "accels", - "atril", NULL); + if (userdir) + { + accel_map_file = g_build_filename(userdir, "accels", "atril", NULL); + } + else + { + accel_map_file = g_build_filename(g_get_home_dir(), ".config", "accels", "atril", NULL); } - gtk_accel_map_load (accel_map_file); - g_free (accel_map_file); + gtk_accel_map_load(accel_map_file); + g_free(accel_map_file); } void @@ -941,7 +943,7 @@ ev_application_shutdown (EvApplication *application) introspection_data = NULL; } #endif /* ENABLE_DBUS */ - + g_free (application->dot_dir); application->dot_dir = NULL; g_free (application->data_dir); @@ -953,28 +955,29 @@ ev_application_shutdown (EvApplication *application) g_object_unref (application); instance = NULL; - + gtk_main_quit (); } -static void -ev_application_class_init (EvApplicationClass *ev_application_class) +static void ev_application_class_init(EvApplicationClass* ev_application_class) { + /* Nothing */ } -static void -ev_application_init (EvApplication *ev_application) +static void ev_application_init(EvApplication* ev_application) { - GError *error = NULL; + GError* error = NULL; + + userdir = g_getenv("MATE22_USER_DIR"); - userdir = g_getenv ("MATE22_USER_DIR"); if (userdir) - ev_application->dot_dir = g_build_filename (userdir, "atril", NULL); + { + ev_application->dot_dir = g_build_filename(userdir, "atril", NULL); + } else - ev_application->dot_dir = g_build_filename (g_get_home_dir (), - ".mate2", - "atril", - NULL); + { + ev_application->dot_dir = g_build_filename(g_get_home_dir(), ".config", "atril", NULL); + } #ifdef G_OS_WIN32 { |