[Xfce4-commits] [xfce/xfdesktop] 24/35: Load emblem-unreadable if necessary

noreply at xfce.org noreply at xfce.org
Sun May 17 11:38:12 CEST 2015


This is an automated email from the git hooks/post-receive script.

eric pushed a commit to branch xfce-4.12
in repository xfce/xfdesktop.

commit 3749863500630e6946cc6b4afbe0a5ae30d03c21
Author: Thaddaeus Tintenfisch <thad.fisch at gmail.com>
Date:   Thu Apr 2 16:17:50 2015 +0200

    Load emblem-unreadable if necessary
---
 src/xfdesktop-regular-file-icon.c |   21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/xfdesktop-regular-file-icon.c b/src/xfdesktop-regular-file-icon.c
index 029b2ff..42e15c9 100644
--- a/src/xfdesktop-regular-file-icon.c
+++ b/src/xfdesktop-regular-file-icon.c
@@ -54,8 +54,9 @@
 #include "xfdesktop-common.h"
 #include "xfdesktop-regular-file-icon.h"
 
-#define EMBLEM_SYMLINK  "emblem-symbolic-link"
-#define EMBLEM_READONLY "emblem-readonly"
+#define EMBLEM_UNREADABLE "emblem-unreadable"
+#define EMBLEM_READONLY   "emblem-readonly"
+#define EMBLEM_SYMLINK    "emblem-symbolic-link"
 
 struct _XfdesktopRegularFileIconPrivate
 {
@@ -505,9 +506,21 @@ xfdesktop_regular_file_icon_load_icon(XfdesktopIcon *icon)
     /* Add any user set emblems */
     gicon = xfdesktop_file_icon_add_emblems(file_icon);
 
-    /* load the read only emblem if necessary */
+    /* load the unreadable emblem if necessary */
     if(!g_file_info_get_attribute_boolean(regular_icon->priv->file_info,
-                                          G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE))
+                                          G_FILE_ATTRIBUTE_ACCESS_CAN_READ))
+    {
+        GIcon *themed_icon = g_themed_icon_new(EMBLEM_UNREADABLE);
+        GEmblem *emblem = g_emblem_new(themed_icon);
+
+        g_emblemed_icon_add_emblem(G_EMBLEMED_ICON(gicon), emblem);
+
+        g_object_unref(emblem);
+        g_object_unref(themed_icon);
+    }
+    /* load the read only emblem if necessary */
+    else if(!g_file_info_get_attribute_boolean(regular_icon->priv->file_info,
+                                               G_FILE_ATTRIBUTE_ACCESS_CAN_WRITE))
     {
         GIcon *themed_icon = g_themed_icon_new(EMBLEM_READONLY);
         GEmblem *emblem = g_emblem_new(themed_icon);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list