aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-print.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-13 06:18:59 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-13 06:24:42 +0800
commit8ff0684fa2e371a80cca60e8df167cc104c473c2 (patch)
treee5cca6b5e8c46feff19eb8e12ab26b4803ebdd3b /mail/em-format-html-print.c
parent6ae1b3fe3c4dfd391de92bfca42e44ff7cc8fe19 (diff)
downloadgsoc2013-evolution-8ff0684fa2e371a80cca60e8df167cc104c473c2.tar
gsoc2013-evolution-8ff0684fa2e371a80cca60e8df167cc104c473c2.tar.gz
gsoc2013-evolution-8ff0684fa2e371a80cca60e8df167cc104c473c2.tar.bz2
gsoc2013-evolution-8ff0684fa2e371a80cca60e8df167cc104c473c2.tar.lz
gsoc2013-evolution-8ff0684fa2e371a80cca60e8df167cc104c473c2.tar.xz
gsoc2013-evolution-8ff0684fa2e371a80cca60e8df167cc104c473c2.tar.zst
gsoc2013-evolution-8ff0684fa2e371a80cca60e8df167cc104c473c2.zip
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().
Diffstat (limited to 'mail/em-format-html-print.c')
-rw-r--r--mail/em-format-html-print.c47
1 files changed, 12 insertions, 35 deletions
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);
}