From a8b5c89d61f4816d46e6b0da2853aea93e569d68 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 3 Jun 2009 11:55:52 -0400 Subject: =?UTF-8?q?Bug=20572543=20=E2=80=93=20Doesn't=20show=20correct=20a?= =?UTF-8?q?pplication=20for=20pdf=20attachments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fix got dropped in the attachment rewrite. Also, ignore the application's NoDisplay setting when building the "open with" menu. That's mainly so "Document Viewer" shows up in the list. --- widgets/misc/e-attachment.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'widgets/misc/e-attachment.c') diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index e9df6024bc..e7a03950db 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -1320,9 +1320,11 @@ GList * e_attachment_list_apps (EAttachment *attachment) { GList *app_info_list; + GList *guessed_infos; GFileInfo *file_info; const gchar *content_type; const gchar *display_name; + gboolean type_is_unknown; gchar *allocated; g_return_val_if_fail (E_IS_ATTACHMENT (attachment), NULL); @@ -1336,18 +1338,22 @@ e_attachment_list_apps (EAttachment *attachment) g_return_val_if_fail (content_type != NULL, NULL); app_info_list = g_app_info_get_all_for_type (content_type); + type_is_unknown = g_content_type_is_unknown (content_type); - if (app_info_list != NULL || display_name == NULL) + if (app_info_list != NULL && !type_is_unknown) goto exit; - if (!g_content_type_is_unknown (content_type)) + if (display_name == NULL) goto exit; allocated = g_content_type_guess (display_name, NULL, 0, NULL); - app_info_list = g_app_info_get_all_for_type (allocated); + guessed_infos = g_app_info_get_all_for_type (allocated); + app_info_list = g_list_concat (guessed_infos, app_info_list); g_free (allocated); exit: + g_debug ("App List Length: %d", g_list_length (app_info_list)); + return app_info_list; } -- cgit v1.2.3