summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-icon-info.c
diff options
context:
space:
mode:
authorJasmine Hassan <[email protected]>2012-10-27 13:14:25 +0200
committerJasmine Hassan <[email protected]>2012-11-16 09:45:50 +0200
commit5680dbcc4995bd860e0e7659481e3d2079b09382 (patch)
treedf41246439352f9e21f80c2068af8d9ff71bc2ab /libcaja-private/caja-icon-info.c
parentc7814e5022409a72afe03743b0198d964e0338b5 (diff)
downloadcaja-5680dbcc4995bd860e0e7659481e3d2079b09382.tar.bz2
caja-5680dbcc4995bd860e0e7659481e3d2079b09382.tar.xz
[icon-info] add a method to fetch GIcons for user special dirs
http://git.gnome.org/browse/nautilus/commit/?id=1df83c6586560a8ae5efc96037e673e52b4b119b
Diffstat (limited to 'libcaja-private/caja-icon-info.c')
-rw-r--r--libcaja-private/caja-icon-info.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/libcaja-private/caja-icon-info.c b/libcaja-private/caja-icon-info.c
index 7873ebfa..5d783877 100644
--- a/libcaja-private/caja-icon-info.c
+++ b/libcaja-private/caja-icon-info.c
@@ -21,6 +21,7 @@
#include <config.h>
#include <string.h>
#include "caja-icon-info.h"
+#include "caja-icon-names.h"
#include "caja-default-file-icon.h"
#include <gtk/gtk.h>
#include <gio/gio.h>
@@ -778,3 +779,29 @@ caja_icon_theme_can_render (GThemedIcon *icon)
return FALSE;
}
+
+GIcon *
+caja_user_special_directory_get_gicon (GUserDirectory directory)
+{
+
+ #define ICON_CASE(x) \
+ case G_USER_DIRECTORY_ ## x:\
+ return g_themed_icon_new (CAJA_ICON_FOLDER_ ## x);
+
+ switch (directory) {
+
+ ICON_CASE (DESKTOP);
+ ICON_CASE (DOCUMENTS);
+ ICON_CASE (DOWNLOAD);
+ ICON_CASE (MUSIC);
+ ICON_CASE (PICTURES);
+ ICON_CASE (PUBLIC_SHARE);
+ ICON_CASE (TEMPLATES);
+ ICON_CASE (VIDEOS);
+
+ default:
+ return g_themed_icon_new ("folder");
+ }
+
+ #undef ICON_CASE
+}