diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-12-05 21:19:04 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-12-08 03:01:04 +0800 |
commit | 91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8 (patch) | |
tree | 1c06f36fa153eee0779cdfa1be1a24f62e93787d /mail/e-mail-reader.c | |
parent | 2f0d83cf74b94d5e6272c07179df6e6c7a929789 (diff) | |
download | gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.tar.gz gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.tar.zst gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.zip |
Make EMailPartList thread-safe.
Exposing data members in the public struct is unwise, especially when
EMailPartList is used from multiple threads. Instead keep the members
private and provide a set of thread-safe functions to manipulate them.
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r-- | mail/e-mail-reader.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 923b3d403c..a659404092 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -281,6 +281,7 @@ action_mail_image_save_cb (GtkAction *action, EMailPartList *parts; const gchar *image_src; CamelMimePart *part; + CamelMimeMessage *message; EAttachment *attachment; GFile *file; @@ -296,11 +297,13 @@ action_mail_image_save_cb (GtkAction *action, parts = e_mail_display_get_parts_list (display); g_return_if_fail (parts != NULL); - g_return_if_fail (parts->message != NULL); + + message = e_mail_part_list_get_message (parts); + g_return_if_fail (message != NULL); if (g_str_has_prefix (image_src, "cid:")) { part = camel_mime_message_get_part_by_content_id ( - parts->message, image_src + 4); + message, image_src + 4); g_return_if_fail (part != NULL); g_object_ref (part); @@ -2697,7 +2700,7 @@ mail_reader_message_seen_cb (EMailReaderClosure *closure) uid_is_current &= (g_strcmp0 (current_uid, message_uid) == 0); if (parts) - message = parts->message; + message = e_mail_part_list_get_message (parts); else message = NULL; @@ -2869,7 +2872,10 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader) parts = e_mail_display_get_parts_list (display); cursor_uid = MESSAGE_LIST (message_list)->cursor_uid; - format_uid = parts ? parts->message_uid : NULL; + if (parts != NULL) + format_uid = e_mail_part_list_get_message_uid (parts); + else + format_uid = NULL; if (MESSAGE_LIST (message_list)->last_sel_single) { GtkWidget *widget; |