summaryrefslogtreecommitdiff
path: root/gtk/gtkrecentmanager.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2008-05-31 18:52:50 +0000
committerEmmanuele Bassi <ebassi@src.gnome.org>2008-05-31 18:52:50 +0000
commitc515ec92e8941e4ba085d096f69d2498f63d7441 (patch)
tree75c126a00ddce7377c4575f8c991fcfb7de47142 /gtk/gtkrecentmanager.c
parentf1405056f22493f6f320800be5bb141a91faa63a (diff)
downloadgtk+-c515ec92e8941e4ba085d096f69d2498f63d7441.tar.gz
Bug 535830 – wrong content type adding an item
2008-05-31 Emmanuele Bassi <ebassi@gnome.org> Bug 535830 – wrong content type adding an item * gtk/gtkrecentmanager.c: (gtk_recent_manager_add_item_query_info): Use the correct API for retrieving the fast MIME type of a URI. (Carlos Garcia Campos) svn path=/trunk/; revision=20262
Diffstat (limited to 'gtk/gtkrecentmanager.c')
-rw-r--r--gtk/gtkrecentmanager.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index 626210f177..076d51e5f3 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -764,7 +764,16 @@ gtk_recent_manager_add_item_query_info (GObject *source_object,
if (file_info)
{
- recent_data.mime_type = g_content_type_get_mime_type (g_file_info_get_content_type (file_info));
+ gchar *content_type;
+
+ content_type = g_file_info_get_attribute_as_string (file_info, G_FILE_ATTRIBUTE_STANDARD_FAST_CONTENT_TYPE);
+
+ if (G_LIKELY (content_type))
+ recent_data.mime_type = g_content_type_get_mime_type (content_type);
+ else
+ recent_data.mime_type = g_strdup (GTK_RECENT_DEFAULT_MIME);
+
+ g_free (content_type);
g_object_unref (file_info);
}
else