From c515ec92e8941e4ba085d096f69d2498f63d7441 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 31 May 2008 18:52:50 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20535830=20=E2=80=93=20wrong=20content=20ty?= =?UTF-8?q?pe=20adding=20an=20item?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-05-31 Emmanuele Bassi 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 --- ChangeLog | 9 +++++++++ gtk/gtkrecentmanager.c | 11 ++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 789beea884..c470a3f84f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-31 Emmanuele Bassi + + 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) + 2008-05-31 Kristian Rietveld Bug 530146 - Setting non-string tooltip with 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