From d300de403de5b9b2d3c2c2f9d371f59859eeaf8c Mon Sep 17 00:00:00 2001 From: pepp Date: Thu, 15 Dec 2011 12:23:52 +0530 Subject: Bug 566793 - Support Drop And Drag Into Nautilus As PDF File --- mail/em-format-html.c | 46 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'mail/em-format-html.c') diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 960cdc1267..55f7aa9841 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -329,7 +329,7 @@ static MailMsgInfo efh_format_info = { }; static gboolean -efh_format_timeout (struct _format_msg *m) +efh_format_helper (struct _format_msg *m, gboolean async) { GtkHTMLStream *hstream; EMFormatHTML *efh = m->format; @@ -343,10 +343,12 @@ efh_format_timeout (struct _format_msg *m) return FALSE; } - d(printf("timeout called ...\n")); - if (p->format_id != -1) { - d(printf(" still waiting for cancellation to take effect, waiting ...\n")); - return TRUE; + if (async) { + d(printf("timeout called ...\n")); + if (p->format_id != -1) { + d(printf(" still waiting for cancellation to take effect, waiting ...\n")); + return TRUE; + } } g_return_val_if_fail (g_queue_is_empty (&p->pending_jobs), FALSE); @@ -400,7 +402,12 @@ efh_format_timeout (struct _format_msg *m) } efh->priv->format_id = m->base.seq; - mail_msg_unordered_push (m); + + if (async) { + mail_msg_unordered_push (m); + } else { + efh_format_exec(m, NULL, NULL); + } } efh->priv->format_timeout_id = 0; @@ -666,6 +673,32 @@ efh_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); } +static gboolean +efh_format_timeout (struct _format_msg *m) +{ + return efh_format_helper (m, TRUE); +} + +void +em_format_html_clone_sync (CamelFolder *folder, + const gchar *uid, + CamelMimeMessage *msg, + EMFormatHTML *efh, + EMFormat *source) +{ + struct _format_msg *m; + + m = mail_msg_new (&efh_format_info); + m->format = efh; + m->format_source = source; + m->folder = folder; + m->uid = g_strdup (uid); + m->message = msg; + + efh_format_helper (m, FALSE); + efh_format_free (m); +} + static void efh_format_clone (EMFormat *emf, CamelFolder *folder, @@ -3399,3 +3432,4 @@ em_format_html_get_cached_image (EMFormatHTML *efh, return camel_data_cache_get ( emfh_http_cache, EMFH_HTTP_CACHE_PATH, image_uri, NULL); } + -- cgit v1.2.3