[evolution/webkit: 94/96] Finish em_format_parse_async in the main thread to avoid some issues when printing



commit 3271ac7fb0cd5f25559cc7a3370f330f4e9f2657
Author: Dan VrÃtil <dvratil redhat com>
Date:   Wed Jan 4 14:50:25 2012 +0100

    Finish em_format_parse_async in the main thread to avoid some issues when printing

 em-format/em-format.c |   56 +++++++++++++++++++++++++++---------------------
 1 files changed, 31 insertions(+), 25 deletions(-)
---
diff --git a/em-format/em-format.c b/em-format/em-format.c
index a23b897..c09d76e 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -1888,43 +1888,49 @@ emf_start_async_parser (GSimpleAsyncResult *result,
                         GCancellable *cancellable)
 {
         em_format_parse (EM_FORMAT (object), NULL, NULL, cancellable);
+
+	g_simple_async_result_complete_in_idle (result);
 }
 
 void
 em_format_parse_async (EMFormat *emf,
-                       CamelMimeMessage *message,
-                       CamelFolder *folder,
-                       GCancellable *cancellable,
-                       GAsyncReadyCallback callback,
-                       gpointer user_data)
+		       CamelMimeMessage *message,
+		       CamelFolder *folder,
+		       GCancellable *cancellable,
+		       GAsyncReadyCallback callback,
+		       gpointer user_data)
 {
-        GSimpleAsyncResult *result;
+	GSimpleAsyncResult *result;
 
-        g_return_if_fail (EM_IS_FORMAT (emf));
+	g_return_if_fail (EM_IS_FORMAT (emf));
 
-        if (g_cancellable_is_cancelled (cancellable))
-          return;
+	if (g_cancellable_is_cancelled (cancellable))
+		return;
 
-        if (message) {
-          g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
+	if (message) {
+		g_return_if_fail (CAMEL_IS_MIME_MESSAGE (message));
 
-          if (emf->message)
-            g_object_unref (emf->message);
-          emf->message = g_object_ref (message);
-        }
+		if (emf->message)
+			g_object_unref (emf->message);
+
+		emf->message = g_object_ref (message);
 
-        if (folder) {
-          g_return_if_fail (CAMEL_IS_FOLDER  (folder));
+	}
 
-          if (emf->folder)
-            g_object_unref (emf->folder);
-          emf->folder = g_object_ref (folder);
-        }
+	if (folder) {
+		g_return_if_fail (CAMEL_IS_FOLDER (folder));
+
+		if (emf->folder)
+			g_object_unref (emf->folder);
+
+		emf->folder = g_object_ref (folder);
+
+	}
 
-        result = g_simple_async_result_new (G_OBJECT (emf), callback, 
-                user_data, em_format_parse_async);
-        g_simple_async_result_run_in_thread (result, emf_start_async_parser,
-                G_PRIORITY_DEFAULT, cancellable);
+	result = g_simple_async_result_new (G_OBJECT (emf), callback,
+					    user_data, em_format_parse_async);
+	g_simple_async_result_run_in_thread (result, emf_start_async_parser,
+					     G_PRIORITY_DEFAULT, cancellable);
 }
 
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]