]> Pileus Git - ~andy/gtk/commitdiff
Add gtk_recent_info_get_gicon()
authorChristian Persch <chpe@gnome.org>
Thu, 29 Apr 2010 13:21:23 +0000 (15:21 +0200)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 22 Oct 2010 10:58:00 +0000 (11:58 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=617174

docs/reference/gtk/gtk3-sections.txt
gtk/gtk.symbols
gtk/gtkrecentmanager.c
gtk/gtkrecentmanager.h

index fc73186672512a190e1ca48c84415279291c7334..f0ba03b67e2588c9ee4af91a89d4732971877a02 100644 (file)
@@ -2625,6 +2625,7 @@ gtk_recent_info_create_app_info
 gtk_recent_info_get_groups
 gtk_recent_info_has_group
 gtk_recent_info_get_icon
+gtk_recent_info_get_gicon
 gtk_recent_info_get_short_name
 gtk_recent_info_get_uri_display
 gtk_recent_info_get_age
index b968d7a09efcf6574b57196aacbf7a533e78291c..8020851041d034970ca2ac91d26b1c7600d6c6d6 100644 (file)
@@ -2797,6 +2797,7 @@ gtk_recent_info_create_app_info
 gtk_recent_info_get_groups G_GNUC_MALLOC
 gtk_recent_info_has_group
 gtk_recent_info_get_icon
+gtk_recent_info_get_gicon
 gtk_recent_info_get_short_name G_GNUC_MALLOC
 gtk_recent_info_get_uri_display G_GNUC_MALLOC
 gtk_recent_info_get_age
index 3bc08c4572e680a000cdf31b2dc9abeb37824926..9730172ba9697dd2ab3d8e387697241a97988354 100644 (file)
@@ -1926,6 +1926,35 @@ gtk_recent_info_get_icon (GtkRecentInfo *info,
   return retval;
 }
 
+/**
+ * gtk_recent_info_get_gicon:
+ * @info: a #GtkRecentInfo
+ *
+ * Retrieves the icon associated to the resource MIME type.
+ *
+ * Return value: a #GIcon containing the icon, or %NULL. Use
+ *   g_object_unref() when finished using the icon
+ *
+ * Since: 2.22
+ */
+GIcon *
+gtk_recent_info_get_gicon (GtkRecentInfo  *info)
+{
+  GIcon *icon = NULL;
+  gchar *content_type;
+
+  g_return_val_if_fail (info != NULL, NULL);
+
+  if (info->mime_type != NULL &&
+      (content_type = g_content_type_from_mime_type (info->mime_type)) != NULL)
+    {
+      icon = g_content_type_get_icon (content_type);
+      g_free (content_type);
+    }
+
+  return icon;
+}
+
 /**
  * gtk_recent_info_is_local:
  * @info: a #GtkRecentInfo
index df5ce0ecdd2fdd8ac64d70cb05ed9ed4716f3309..9fdb94230944921335071c301253e19ffa1af1c5 100644 (file)
@@ -218,6 +218,7 @@ gboolean              gtk_recent_info_has_group            (GtkRecentInfo  *info
                                                            const gchar    *group_name);
 GdkPixbuf *           gtk_recent_info_get_icon             (GtkRecentInfo  *info,
                                                            gint            size);
+GIcon *               gtk_recent_info_get_gicon            (GtkRecentInfo  *info);
 gchar *               gtk_recent_info_get_short_name       (GtkRecentInfo  *info) G_GNUC_MALLOC;
 gchar *               gtk_recent_info_get_uri_display      (GtkRecentInfo  *info) G_GNUC_MALLOC;
 gint                  gtk_recent_info_get_age              (GtkRecentInfo  *info);