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 /em-format/e-mail-part-list.h | |
parent | 2f0d83cf74b94d5e6272c07179df6e6c7a929789 (diff) | |
download | gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.tar gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.tar.gz gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.tar.bz2 gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.tar.lz gsoc2013-evolution-91822b42dc7b5eb64cad2626f9fc620a2ee6a2c8.tar.xz 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 'em-format/e-mail-part-list.h')
-rw-r--r-- | em-format/e-mail-part-list.h | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/em-format/e-mail-part-list.h b/em-format/e-mail-part-list.h index c6f952eab3..3694075100 100644 --- a/em-format/e-mail-part-list.h +++ b/em-format/e-mail-part-list.h @@ -16,8 +16,8 @@ * */ -#ifndef E_MAIL_PART_LIST_H_ -#define E_MAIL_PART_LIST_H_ +#ifndef E_MAIL_PART_LIST_H +#define E_MAIL_PART_LIST_H #include <camel/camel.h> #include <em-format/e-mail-part.h> @@ -45,35 +45,37 @@ G_BEGIN_DECLS typedef struct _EMailPartList EMailPartList; typedef struct _EMailPartListClass EMailPartListClass; +typedef struct _EMailPartListPrivate EMailPartListPrivate; struct _EMailPartList { GObject parent; - - CamelMimeMessage *message; - CamelFolder *folder; - gchar *message_uid; - - /* GSList of EMailPart's */ - GSList *list; + EMailPartListPrivate *priv; }; struct _EMailPartListClass { GObjectClass parent_class; }; -EMailPartList * e_mail_part_list_new (void); - -GType e_mail_part_list_get_type (void); - -EMailPart * e_mail_part_list_find_part (EMailPartList *part_list, - const gchar *id); - -GSList * e_mail_part_list_get_iter (GSList *list, - const gchar *id); +GType e_mail_part_list_get_type (void) G_GNUC_CONST; +EMailPartList * e_mail_part_list_new (CamelMimeMessage *message, + const gchar *message_uid, + CamelFolder *folder); +CamelFolder * e_mail_part_list_get_folder (EMailPartList *part_list); +CamelMimeMessage * + e_mail_part_list_get_message (EMailPartList *part_list); +const gchar * e_mail_part_list_get_message_uid + (EMailPartList *part_list); +void e_mail_part_list_add_part (EMailPartList *part_list, + EMailPart *part); +EMailPart * e_mail_part_list_ref_part (EMailPartList *part_list, + const gchar *part_id); +guint e_mail_part_list_queue_parts (EMailPartList *part_list, + const gchar *part_id, + GQueue *result_queue); CamelObjectBag * e_mail_part_list_get_registry (void); G_END_DECLS -#endif /* E_MAIL_PART_LIST_H_ */ +#endif /* E_MAIL_PART_LIST_H */ |