From 129eb074823101102611690f053ffa246bb7784d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 Jun 2009 01:45:34 -0400 Subject: [PATCH] Support special icons for xdg user dirs The icon names are folder-documents, folder-download, folder-music, folder-pictures, folder-publicshare, folder-templates, folder-videos. See bug 541276. --- gio/glocalfileinfo.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index 8289ef4..95ccf2e 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -1577,9 +1577,23 @@ _g_local_file_info_get (const char *basename, if (strcmp (path, g_get_home_dir ()) == 0) icon = g_themed_icon_new ("user-home"); - else if (strcmp (path, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0) + else if (strcmp (path, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0) icon = g_themed_icon_new ("user-desktop"); - else + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_DOCUMENTS)) == 0) + icon = g_themed_icon_new_with_default_fallbacks ("folder-documents"); + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD)) == 0) + icon = g_themed_icon_new_with_default_fallbacks ("folder-download"); + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_MUSIC)) == 0) + icon = g_themed_icon_new_with_default_fallbacks ("folder-music"); + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_PICTURES)) == 0) + icon = g_themed_icon_new_with_default_fallbacks ("folder-pictures"); + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_PUBLIC_SHARE)) == 0) + icon = g_themed_icon_new_with_default_fallbacks ("folder-publicshare"); + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_TEMPLATES)) == 0) + icon = g_themed_icon_new_with_default_fallbacks ("folder-templates"); + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_VIDEOS)) == 0) + icon = g_themed_icon_new_with_default_fallbacks ("folder-videos"); + else { icon = g_content_type_get_icon (content_type); if (G_IS_THEMED_ICON (icon)) -- 2.7.4