From 0477a65401f042cfbae9a636ab76b89f25a6468a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 12 May 2011 18:18:59 -0400 Subject: em_format_html_print_message(): Require a CamelMimeMessage. Let EMailReader fetch the CamelMimeMessage itself, handle errors, and then pass it off to EMFormatHTMLPrint. This also eliminates the need for em_format_html_print_raw_message(). --- mail/em-format-html-print.c | 47 ++++++++++++--------------------------------- 1 file changed, 12 insertions(+), 35 deletions(-) (limited to 'mail/em-format-html-print.c') diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c index 1be0e5ed63..e6da0c983a 100644 --- a/mail/em-format-html-print.c +++ b/mail/em-format-html-print.c @@ -222,36 +222,14 @@ emfhp_complete (EMFormatHTMLPrint *efhp) g_object_unref (operation); } -static void -emfhp_got_message (CamelFolder *folder, - const gchar *uid, - CamelMimeMessage *msg, - gpointer data) -{ - EMFormatHTMLPrint *efhp = data; - - if (msg == NULL) { - g_object_unref (efhp); - return; - } - - em_format_html_load_images (EM_FORMAT_HTML (efhp)); - - g_signal_connect ( - efhp, "complete", G_CALLBACK (emfhp_complete), efhp); - - /* FIXME Not passing a GCancellable here. */ - em_format_format_clone ( - (EMFormat *) efhp, folder, uid, msg, - (EMFormat *) efhp->source, NULL); -} - void em_format_html_print_message (EMFormatHTMLPrint *efhp, + CamelMimeMessage *message, CamelFolder *folder, - const gchar *uid) + const gchar *message_uid) { - g_object_ref (efhp); + g_return_if_fail (EM_IS_FORMAT_HTML_PRINT (efhp)); + g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message)); /* Wrap flags to display all entries by default.*/ EM_FORMAT_HTML (efhp)->header_wrap_flags |= @@ -259,15 +237,14 @@ em_format_html_print_message (EMFormatHTMLPrint *efhp, EM_FORMAT_HTML_HEADER_CC | EM_FORMAT_HTML_HEADER_BCC; - mail_get_message ( - folder, uid, emfhp_got_message, efhp, mail_msg_unordered_push); -} + em_format_html_load_images (EM_FORMAT_HTML (efhp)); -void -em_format_html_print_raw_message (EMFormatHTMLPrint *efhp, - CamelMimeMessage *msg) -{ - g_object_ref (efhp); + g_signal_connect ( + efhp, "complete", G_CALLBACK (emfhp_complete), efhp); - emfhp_got_message (NULL, NULL, msg, efhp); + /* FIXME Not passing a GCancellable here. */ + em_format_format_clone ( + EM_FORMAT (efhp), + folder, message_uid, message, + EM_FORMAT (efhp->source), NULL); } -- cgit v1.2.3