diff options
-rw-r--r-- | em-format/e-mail-parser-application-mbox.c | 11 | ||||
-rw-r--r-- | em-format/e-mail-parser-application-smime.c | 8 | ||||
-rw-r--r-- | em-format/e-mail-parser-extension.c | 19 | ||||
-rw-r--r-- | em-format/e-mail-parser-extension.h | 6 | ||||
-rw-r--r-- | em-format/e-mail-parser-message-rfc822.c | 11 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-digest.c | 8 | ||||
-rw-r--r-- | em-format/e-mail-parser-multipart-mixed.c | 8 | ||||
-rw-r--r-- | em-format/e-mail-part-utils.c | 9 | ||||
-rw-r--r-- | modules/audio-inline/e-mail-parser-audio-inline.c | 8 | ||||
-rw-r--r-- | modules/itip-formatter/e-mail-parser-itip.c | 8 | ||||
-rw-r--r-- | modules/vcard-inline/e-mail-parser-vcard-inline.c | 8 |
11 files changed, 20 insertions, 84 deletions
diff --git a/em-format/e-mail-parser-application-mbox.c b/em-format/e-mail-parser-application-mbox.c index d4ff6b11bf..36fa6d5f01 100644 --- a/em-format/e-mail-parser-application-mbox.c +++ b/em-format/e-mail-parser-application-mbox.c @@ -160,19 +160,14 @@ empe_app_mbox_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_app_mbox_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_INLINE | - E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; -} - static void e_mail_parser_application_mbox_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = + E_MAIL_PARSER_EXTENSION_INLINE | + E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; class->parse = empe_app_mbox_parse; - class->get_flags = empe_app_mbox_get_flags; } static void diff --git a/em-format/e-mail-parser-application-smime.c b/em-format/e-mail-parser-application-smime.c index 29e623b52c..21593d326e 100644 --- a/em-format/e-mail-parser-application-smime.c +++ b/em-format/e-mail-parser-application-smime.c @@ -150,18 +150,12 @@ empe_app_smime_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_app_smime_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_INLINE; -} - static void e_mail_parser_application_smime_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = E_MAIL_PARSER_EXTENSION_INLINE; class->parse = empe_app_smime_parse; - class->get_flags = empe_app_smime_get_flags; } static void diff --git a/em-format/e-mail-parser-extension.c b/em-format/e-mail-parser-extension.c index b20ae90e32..05fd952fe6 100644 --- a/em-format/e-mail-parser-extension.c +++ b/em-format/e-mail-parser-extension.c @@ -25,16 +25,9 @@ G_DEFINE_ABSTRACT_TYPE ( e_mail_parser_extension, G_TYPE_OBJECT) -static guint32 -mail_parser_extension_get_flags (EMailParserExtension *extension) -{ - return 0; -} - static void e_mail_parser_extension_class_init (EMailParserExtensionClass *class) { - class->get_flags = mail_parser_extension_get_flags; } static void @@ -100,15 +93,3 @@ e_mail_parser_extension_parse (EMailParserExtension *extension, cancellable, out_mail_parts); } -guint32 -e_mail_parser_extension_get_flags (EMailParserExtension *extension) -{ - EMailParserExtensionClass *class; - - g_return_val_if_fail (E_IS_MAIL_PARSER_EXTENSION (extension), 0); - - class = E_MAIL_PARSER_EXTENSION_GET_CLASS (extension); - g_return_val_if_fail (class->get_flags != NULL, 0); - - return class->get_flags (extension); -} diff --git a/em-format/e-mail-parser-extension.h b/em-format/e-mail-parser-extension.h index e510a15591..fdd48bf617 100644 --- a/em-format/e-mail-parser-extension.h +++ b/em-format/e-mail-parser-extension.h @@ -84,13 +84,15 @@ struct _EMailParserExtensionClass { * wildcard (e.g. "text/ *"). */ const gchar **mime_types; + /* See the flag descriptions above. */ + EMailParserExtensionFlags flags; + gboolean (*parse) (EMailParserExtension *extension, EMailParser *parser, CamelMimePart *mime_part, GString *part_id, GCancellable *cancellable, GQueue *out_mail_parts); - guint32 (*get_flags) (EMailParserExtension *extension); }; GType e_mail_parser_extension_get_type @@ -101,8 +103,6 @@ gboolean e_mail_parser_extension_parse (EMailParserExtension *extension, GString *part_id, GCancellable *cancellable, GQueue *out_mail_parts); -guint32 e_mail_parser_extension_get_flags - (EMailParserExtension *extension); G_END_DECLS diff --git a/em-format/e-mail-parser-message-rfc822.c b/em-format/e-mail-parser-message-rfc822.c index d2cd7ee7fe..5239c3c743 100644 --- a/em-format/e-mail-parser-message-rfc822.c +++ b/em-format/e-mail-parser-message-rfc822.c @@ -123,19 +123,14 @@ empe_msg_rfc822_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_msg_rfc822_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_INLINE | - E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; -} - static void e_mail_parser_message_rfc822_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = + E_MAIL_PARSER_EXTENSION_INLINE | + E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; class->parse = empe_msg_rfc822_parse; - class->get_flags = empe_msg_rfc822_get_flags; } static void diff --git a/em-format/e-mail-parser-multipart-digest.c b/em-format/e-mail-parser-multipart-digest.c index 2097b0cab8..6f22a44572 100644 --- a/em-format/e-mail-parser-multipart-digest.c +++ b/em-format/e-mail-parser-multipart-digest.c @@ -117,18 +117,12 @@ empe_mp_digest_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_mp_digest_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; -} - static void e_mail_parser_multipart_digest_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; class->parse = empe_mp_digest_parse; - class->get_flags = empe_mp_digest_get_flags; } static void diff --git a/em-format/e-mail-parser-multipart-mixed.c b/em-format/e-mail-parser-multipart-mixed.c index 67671afc1d..6a202bd889 100644 --- a/em-format/e-mail-parser-multipart-mixed.c +++ b/em-format/e-mail-parser-multipart-mixed.c @@ -115,18 +115,12 @@ empe_mp_mixed_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_mp_mixed_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; -} - static void e_mail_parser_multipart_mixed_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = E_MAIL_PARSER_EXTENSION_COMPOUND_TYPE; class->parse = empe_mp_mixed_parse; - class->get_flags = empe_mp_mixed_get_flags; } static void diff --git a/em-format/e-mail-part-utils.c b/em-format/e-mail-part-utils.c index 6f8013d7a8..665a7b5996 100644 --- a/em-format/e-mail-part-utils.c +++ b/em-format/e-mail-part-utils.c @@ -533,15 +533,17 @@ e_mail_part_is_inline (CamelMimePart *mime_part, { const gchar *disposition; EMailParserExtension *extension; + EMailParserExtensionClass *class; if ((extensions == NULL) || g_queue_is_empty (extensions)) return FALSE; extension = g_queue_peek_head (extensions); + class = E_MAIL_PARSER_EXTENSION_GET_CLASS (extension); + /* Some types need to override the disposition. * e.g. application/x-pkcs7-mime */ - if (e_mail_parser_extension_get_flags (extension) & - E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION) + if (class->flags & E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION) return TRUE; disposition = camel_mime_part_get_disposition (mime_part); @@ -549,6 +551,5 @@ e_mail_part_is_inline (CamelMimePart *mime_part, return g_ascii_strcasecmp (disposition, "inline") == 0; /* Otherwise, use the default for this handler type. */ - return (e_mail_parser_extension_get_flags (extension) & - E_MAIL_PARSER_EXTENSION_INLINE) != 0; + return (class->flags & E_MAIL_PARSER_EXTENSION_INLINE) != 0; } diff --git a/modules/audio-inline/e-mail-parser-audio-inline.c b/modules/audio-inline/e-mail-parser-audio-inline.c index 519f6ce428..a4ef834e1e 100644 --- a/modules/audio-inline/e-mail-parser-audio-inline.c +++ b/modules/audio-inline/e-mail-parser-audio-inline.c @@ -145,18 +145,12 @@ empe_audio_inline_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_audio_inline_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; -} - static void e_mail_parser_audio_inline_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; class->parse = empe_audio_inline_parse; - class->get_flags = empe_audio_inline_get_flags; } static void diff --git a/modules/itip-formatter/e-mail-parser-itip.c b/modules/itip-formatter/e-mail-parser-itip.c index a63fc2fc56..554d863957 100644 --- a/modules/itip-formatter/e-mail-parser-itip.c +++ b/modules/itip-formatter/e-mail-parser-itip.c @@ -248,18 +248,12 @@ empe_itip_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_itip_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; -} - static void e_mail_parser_itip_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; class->parse = empe_itip_parse; - class->get_flags = empe_itip_get_flags; } static void diff --git a/modules/vcard-inline/e-mail-parser-vcard-inline.c b/modules/vcard-inline/e-mail-parser-vcard-inline.c index 1328e5031a..67f357440b 100644 --- a/modules/vcard-inline/e-mail-parser-vcard-inline.c +++ b/modules/vcard-inline/e-mail-parser-vcard-inline.c @@ -369,18 +369,12 @@ empe_vcard_inline_parse (EMailParserExtension *extension, return TRUE; } -static guint32 -empe_vcard_inline_get_flags (EMailParserExtension *extension) -{ - return E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; -} - static void e_mail_parser_vcard_inline_class_init (EMailParserExtensionClass *class) { class->mime_types = parser_mime_types; + class->flags = E_MAIL_PARSER_EXTENSION_INLINE_DISPOSITION; class->parse = empe_vcard_inline_parse; - class->get_flags = empe_vcard_inline_get_flags; } static void |