diff options
author | Christian Persch <chpe@gnome.org> | 2010-04-29 15:21:23 +0200 |
---|---|---|
committer | Emmanuele Bassi <ebassi@linux.intel.com> | 2010-10-22 11:58:00 +0100 |
commit | b0fe3e49bbf788c9dd81d8c2f236666cc78d972d (patch) | |
tree | e5a87332ea52e2f705ab702bee2909a48fa22b81 /gtk/gtkrecentmanager.c | |
parent | 27b71e0143fc90a733fb59ccd957dc6958544c6e (diff) | |
download | gtk+-b0fe3e49bbf788c9dd81d8c2f236666cc78d972d.tar.gz |
Add gtk_recent_info_get_gicon()
https://bugzilla.gnome.org/show_bug.cgi?id=617174
Diffstat (limited to 'gtk/gtkrecentmanager.c')
-rw-r--r-- | gtk/gtkrecentmanager.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c index 3bc08c4572..9730172ba9 100644 --- a/gtk/gtkrecentmanager.c +++ b/gtk/gtkrecentmanager.c @@ -1927,6 +1927,35 @@ gtk_recent_info_get_icon (GtkRecentInfo *info, } /** + * 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 * |