[gtk+] recent manager: always return a GIcon



commit 6c57432e79a5cf4e8691f6b5ce54726847ee5ef3
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 22 22:20:12 2017 +0200

    recent manager: always return a GIcon
    
    Make gtk_recent_info_get_gicon return a useful GIcon in
    all cases.

 gtk/gtkrecentmanager.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index 734eb44..65bb375 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -2071,6 +2071,14 @@ gtk_recent_info_get_gicon (GtkRecentInfo *info)
       icon = g_content_type_get_icon (content_type);
       g_free (content_type);
     }
+  else
+    {
+      if (info->mime_type &&
+          strcmp (info->mime_type, "x-directory/normal") == 0)
+        icon = g_themed_icon_new ("folder");
+      else
+        icon = g_themed_icon_new ("text-x-generic");
+    }
 
   return icon;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]