|
|
7c6d83 |
diff -up evolution-3.8.5/em-format/e-mail-formatter-attachment-bar.c.formatter-in-main evolution-3.8.5/em-format/e-mail-formatter-attachment-bar.c
|
|
|
7c6d83 |
--- evolution-3.8.5/em-format/e-mail-formatter-attachment-bar.c.formatter-in-main 2013-07-23 14:51:35.000000000 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/em-format/e-mail-formatter-attachment-bar.c 2014-07-23 17:41:40.399807290 +0200
|
|
|
7c6d83 |
@@ -89,11 +89,11 @@ emfe_attachment_bar_get_widget (EMailFor
|
|
|
7c6d83 |
g_return_val_if_fail (E_MAIL_PART_IS (part, EMailPartAttachmentBar), NULL);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
empab = (EMailPartAttachmentBar *) part;
|
|
|
7c6d83 |
- widget = e_attachment_bar_new (empab->store);
|
|
|
7c6d83 |
- g_object_set_data (G_OBJECT (empab->store), "attachment-bar", widget);
|
|
|
7c6d83 |
+ widget = e_attachment_bar_new (e_mail_part_attachment_bar_get_store (empab));
|
|
|
7c6d83 |
+ g_object_set_data (G_OBJECT (e_mail_part_attachment_bar_get_store (empab)), "attachment-bar", widget);
|
|
|
7c6d83 |
g_object_weak_ref (
|
|
|
7c6d83 |
G_OBJECT (widget),
|
|
|
7c6d83 |
- (GWeakNotify) unset_bar_from_store_data, empab->store);
|
|
|
7c6d83 |
+ (GWeakNotify) unset_bar_from_store_data, e_mail_part_attachment_bar_get_store (empab));
|
|
|
7c6d83 |
|
|
|
7c6d83 |
return widget;
|
|
|
7c6d83 |
}
|
|
|
7c6d83 |
diff -up evolution-3.8.5/em-format/e-mail-formatter-attachment.c.formatter-in-main evolution-3.8.5/em-format/e-mail-formatter-attachment.c
|
|
|
7c6d83 |
--- evolution-3.8.5/em-format/e-mail-formatter-attachment.c.formatter-in-main 2013-07-23 14:51:36.000000000 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/em-format/e-mail-formatter-attachment.c 2014-07-23 17:41:40.399807290 +0200
|
|
|
7c6d83 |
@@ -94,7 +94,7 @@ find_attachment_store (EMailPartList *pa
|
|
|
7c6d83 |
g_free (tmp);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
if (part != NULL)
|
|
|
7c6d83 |
- store = ((EMailPartAttachmentBar *) part)->store;
|
|
|
7c6d83 |
+ store = e_mail_part_attachment_bar_get_store ((EMailPartAttachmentBar *) part);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
while (!g_queue_is_empty (&queue))
|
|
|
7c6d83 |
e_mail_part_unref (g_queue_pop_head (&queue));
|
|
|
7c6d83 |
diff -up evolution-3.8.5/em-format/e-mail-parser-attachment-bar.c.formatter-in-main evolution-3.8.5/em-format/e-mail-parser-attachment-bar.c
|
|
|
7c6d83 |
--- evolution-3.8.5/em-format/e-mail-parser-attachment-bar.c.formatter-in-main 2013-07-23 14:51:35.000000000 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/em-format/e-mail-parser-attachment-bar.c 2014-07-23 17:41:40.399807290 +0200
|
|
|
7c6d83 |
@@ -28,12 +28,40 @@
|
|
|
7c6d83 |
|
|
|
7c6d83 |
#include "e-mail-parser-extension.h"
|
|
|
7c6d83 |
|
|
|
7c6d83 |
+struct _EMailPartAttachmentBarPrivate
|
|
|
7c6d83 |
+{
|
|
|
7c6d83 |
+ EAttachmentStore *store;
|
|
|
7c6d83 |
+};
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
static void
|
|
|
7c6d83 |
mail_part_attachment_bar_free (EMailPart *part)
|
|
|
7c6d83 |
{
|
|
|
7c6d83 |
EMailPartAttachmentBar *empab = (EMailPartAttachmentBar *) part;
|
|
|
7c6d83 |
|
|
|
7c6d83 |
- g_clear_object (&empab->store);
|
|
|
7c6d83 |
+ if (empab->priv) {
|
|
|
7c6d83 |
+ g_clear_object (&empab->priv->store);
|
|
|
7c6d83 |
+ g_free (empab->priv);
|
|
|
7c6d83 |
+ empab->priv = NULL;
|
|
|
7c6d83 |
+ }
|
|
|
7c6d83 |
+}
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+EAttachmentStore *
|
|
|
7c6d83 |
+e_mail_part_attachment_bar_get_store (EMailPartAttachmentBar *empab)
|
|
|
7c6d83 |
+{
|
|
|
7c6d83 |
+ g_return_val_if_fail (empab != NULL, NULL);
|
|
|
7c6d83 |
+ g_return_val_if_fail (empab->priv != NULL, NULL);
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ if (!empab->priv->store) {
|
|
|
7c6d83 |
+ /* Create the store only on demand. The EMailParser runs in a dedicated
|
|
|
7c6d83 |
+ thread, but the EAttachmentStore is a GtkWidget descendant, which should
|
|
|
7c6d83 |
+ be manipulated only from the main/UI thread, thus postpone its creating
|
|
|
7c6d83 |
+ until it's really needed, which might be during the EMailFormatter run,
|
|
|
7c6d83 |
+ which runs from the main/UI thread. */
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ empab->priv->store = E_ATTACHMENT_STORE (e_attachment_store_new ());
|
|
|
7c6d83 |
+ }
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
+ return empab->priv->store;
|
|
|
7c6d83 |
}
|
|
|
7c6d83 |
|
|
|
7c6d83 |
/******************************************************************************/
|
|
|
7c6d83 |
@@ -70,7 +98,7 @@ empe_attachment_bar_parse (EMailParserEx
|
|
|
7c6d83 |
part, part_id->str, sizeof (EMailPartAttachmentBar),
|
|
|
7c6d83 |
(GFreeFunc) mail_part_attachment_bar_free);
|
|
|
7c6d83 |
empab->parent.mime_type = g_strdup ("application/vnd.evolution.widget.attachment-bar");
|
|
|
7c6d83 |
- empab->store = E_ATTACHMENT_STORE (e_attachment_store_new ());
|
|
|
7c6d83 |
+ empab->priv = g_new0 (EMailPartAttachmentBarPrivate, 1);
|
|
|
7c6d83 |
g_string_truncate (part_id, len);
|
|
|
7c6d83 |
|
|
|
7c6d83 |
g_queue_push_tail (out_mail_parts, empab);
|
|
|
7c6d83 |
diff -up evolution-3.8.5/em-format/e-mail-part-attachment-bar.h.formatter-in-main evolution-3.8.5/em-format/e-mail-part-attachment-bar.h
|
|
|
7c6d83 |
--- evolution-3.8.5/em-format/e-mail-part-attachment-bar.h.formatter-in-main 2013-07-23 14:51:36.000000000 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/em-format/e-mail-part-attachment-bar.h 2014-07-23 17:41:40.399807290 +0200
|
|
|
7c6d83 |
@@ -23,10 +23,14 @@
|
|
|
7c6d83 |
|
|
|
7c6d83 |
#include <em-format/e-mail-part.h>
|
|
|
7c6d83 |
|
|
|
7c6d83 |
+typedef struct _EMailPartAttachmentBarPrivate EMailPartAttachmentBarPrivate;
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
typedef struct _EMailPartAttachmentBar {
|
|
|
7c6d83 |
EMailPart parent;
|
|
|
7c6d83 |
|
|
|
7c6d83 |
- EAttachmentStore *store;
|
|
|
7c6d83 |
+ EMailPartAttachmentBarPrivate *priv;
|
|
|
7c6d83 |
} EMailPartAttachmentBar;
|
|
|
7c6d83 |
|
|
|
7c6d83 |
+EAttachmentStore *e_mail_part_attachment_bar_get_store (EMailPartAttachmentBar *empab);
|
|
|
7c6d83 |
+
|
|
|
7c6d83 |
#endif /* E_MAIL_PART_ATTACHMENT_BAR_H */
|
|
|
7c6d83 |
diff -up evolution-3.8.5/mail/e-mail-request.c.formatter-in-main evolution-3.8.5/mail/e-mail-request.c
|
|
|
7c6d83 |
--- evolution-3.8.5/mail/e-mail-request.c.formatter-in-main 2013-07-23 14:51:56.000000000 +0200
|
|
|
7c6d83 |
+++ evolution-3.8.5/mail/e-mail-request.c 2014-07-23 17:41:40.400807290 +0200
|
|
|
7c6d83 |
@@ -364,9 +364,12 @@ mail_request_send_async (SoupRequest *re
|
|
|
7c6d83 |
simple, handle_contact_photo_request,
|
|
|
7c6d83 |
G_PRIORITY_DEFAULT, cancellable);
|
|
|
7c6d83 |
} else {
|
|
|
7c6d83 |
- g_simple_async_result_run_in_thread (
|
|
|
7c6d83 |
- simple, handle_mail_request,
|
|
|
7c6d83 |
- G_PRIORITY_DEFAULT, cancellable);
|
|
|
7c6d83 |
+ /* Process e-mail mail requests in this thread, which should be
|
|
|
7c6d83 |
+ the main/UI thread, because any EMailFormatter can create
|
|
|
7c6d83 |
+ GtkWidget-s, or manipulate with them, which should be always
|
|
|
7c6d83 |
+ done in the main/UI thread. */
|
|
|
7c6d83 |
+ handle_mail_request (simple, G_OBJECT (request), cancellable);
|
|
|
7c6d83 |
+ g_simple_async_result_complete_in_idle (simple);
|
|
|
7c6d83 |
}
|
|
|
7c6d83 |
|
|
|
7c6d83 |
g_object_unref (simple);
|