Use g_get_user_special_dir() to obtain the path for the DESKTOP directory.

2007-06-06  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkfilechooserbutton.c (model_add_special):
        * gtk/gtkfilechooserdefault.c (shortcuts_append_desktop):
        * gtk/gtkfilesystemunix.c (get_icon_name_for_directory):
        * gtk/gtkpathbar.c (_gtk_path_bar_set_file_system):
        Use g_get_user_special_dir() to obtain the path for the
        DESKTOP directory.

svn path=/trunk/; revision=18070
This commit is contained in:
Matthias Clasen
2007-06-07 04:23:10 +00:00
committed by Matthias Clasen
parent ba95b0598b
commit 232f30f1ba
5 changed files with 27 additions and 35 deletions

View File

@ -1601,17 +1601,12 @@ gtk_file_system_unix_filename_to_path (GtkFileSystem *file_system,
static const char *
get_icon_name_for_directory (const char *path)
{
static char *desktop_path = NULL;
if (!g_get_home_dir ())
return "gnome-fs-directory";
if (!desktop_path)
desktop_path = g_build_filename (g_get_home_dir (), "Desktop", NULL);
if (strcmp (g_get_home_dir (), path) == 0)
return "gnome-fs-home";
else if (strcmp (desktop_path, path) == 0)
else if (strcmp (g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP), path) == 0)
return "gnome-fs-desktop";
else
return "gnome-fs-directory";