From f6f9877b50c5090e4f226ab52a4a3a32b17de1c7 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 6 Jun 2007 19:05:53 +0000 Subject: [PATCH] Fall back to $HOME/Desktop for the DESKTOP directory, like 2007-06-06 Matthias Clasen * glib/gutils.c (g_get_user_special_dir): Fall back to $HOME/Desktop for the DESKTOP directory, like xdg_user_dir_lookup() does. svn path=/trunk/; revision=5543 --- ChangeLog | 6 ++++++ glib/gutils.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 96138f08a..f595ed4bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-06-06 Matthias Clasen + + * glib/gutils.c (g_get_user_special_dir): Fall back to + $HOME/Desktop for the DESKTOP directory, like + xdg_user_dir_lookup() does. + 2007-06-05 Matthias Clasen * configure.in: Bump version diff --git a/glib/gutils.c b/glib/gutils.c index 6565e8eb1..e9ae8d1b8 100644 --- a/glib/gutils.c +++ b/glib/gutils.c @@ -2436,7 +2436,15 @@ g_get_user_special_dir (GUserDirectory directory) if (g_user_special_dirs == NULL) { g_user_special_dirs = g_new0 (gchar *, G_USER_N_DIRECTORIES); + load_user_special_dirs (); + + /* Special-case desktop for historical compatibility */ + if (g_user_special_dirs[G_USER_DIRECTORY_DESKTOP] == NULL) + { + g_get_any_init (); + g_user_special_dirs[directory] = g_build_filename (g_home_dir, "Desktop", NULL); + } } G_UNLOCK (g_utils_global);