aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
authorpepp <pelloux@gmail.com>2011-12-15 14:53:52 +0800
committerChenthill Palanisamy <pchenthill@novell.com>2011-12-15 15:18:26 +0800
commitd300de403de5b9b2d3c2c2f9d371f59859eeaf8c (patch)
tree508e5bc436b5d14369aaf4d9a741ff201eaeb165 /mail/em-format-html.c
parentbe607ffe63925ccaa70c33c8f7766c6bf65ad80a (diff)
downloadgsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.gz
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.bz2
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.lz
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.xz
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.tar.zst
gsoc2013-evolution-d300de403de5b9b2d3c2c2f9d371f59859eeaf8c.zip
Bug 566793 - Support Drop And Drag Into Nautilus As PDF File
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c46
1 files changed, 40 insertions, 6 deletions
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);
}
+