aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-04-29 22:21:12 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-04-29 22:21:47 +0800
commit747db5952db1ac5251ea9d3b47780ed441ed77ed (patch)
tree18706753f15f744f76ec44b3af03ed75d46f0299
parenta5447adfe6d3579f32305933c9b0d2b27e33eaac (diff)
downloadgsoc2013-evolution-747db5952db1ac5251ea9d3b47780ed441ed77ed.tar
gsoc2013-evolution-747db5952db1ac5251ea9d3b47780ed441ed77ed.tar.gz
gsoc2013-evolution-747db5952db1ac5251ea9d3b47780ed441ed77ed.tar.bz2
gsoc2013-evolution-747db5952db1ac5251ea9d3b47780ed441ed77ed.tar.lz
gsoc2013-evolution-747db5952db1ac5251ea9d3b47780ed441ed77ed.tar.xz
gsoc2013-evolution-747db5952db1ac5251ea9d3b47780ed441ed77ed.tar.zst
gsoc2013-evolution-747db5952db1ac5251ea9d3b47780ed441ed77ed.zip
EMFormat: Cleanups.
-rw-r--r--em-format/em-format-quote.c8
-rw-r--r--em-format/em-format.c78
-rw-r--r--em-format/em-format.h273
3 files changed, 171 insertions, 188 deletions
diff --git a/em-format/em-format-quote.c b/em-format/em-format-quote.c
index c3231785bf..b74da215f4 100644
--- a/em-format/em-format-quote.c
+++ b/em-format/em-format-quote.c
@@ -524,9 +524,9 @@ emfq_write_attachment (EMFormat *emf,
static void
emfq_write (EMFormat *emf,
- CamelStream *stream,
- EMFormatWriterInfo *info,
- GCancellable *cancellable)
+ CamelStream *stream,
+ EMFormatWriterInfo *info,
+ GCancellable *cancellable)
{
GList *iter;
@@ -572,7 +572,7 @@ emfq_init (EMFormatQuote *emfq)
emfq->priv->text_html_flags =
CAMEL_MIME_FILTER_TOHTML_PRE |
CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS |
- CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES;
+ CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES;
}
GType
diff --git a/em-format/em-format.c b/em-format/em-format.c
index c3f790df18..becd43f3f7 100644
--- a/em-format/em-format.c
+++ b/em-format/em-format.c
@@ -141,7 +141,7 @@ preserve_charset_in_content_type (CamelMimePart *ipart,
static CamelMimePart *
get_related_display_part (CamelMimePart *part,
- gint *out_displayid)
+ gint *out_displayid)
{
CamelMultipart *mp;
CamelMimePart *body_part, *display_part = NULL;
@@ -267,10 +267,10 @@ emf_parse_application_xpkcs7mime (EMFormat *emf,
/* RFC 4155 */
static void
emf_parse_application_mbox (EMFormat *emf,
- CamelMimePart *mime_part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable)
+ CamelMimePart *mime_part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable)
{
CamelMimeParser *parser;
CamelStream *mem_stream;
@@ -345,9 +345,9 @@ emf_parse_application_mbox (EMFormat *emf,
/* RFC 1740 */
static void
emf_parse_multipart_alternative (EMFormat *emf,
- CamelMimePart *part,
+ CamelMimePart *part,
GString *part_id,
- EMFormatParserInfo *info,
+ EMFormatParserInfo *info,
GCancellable *cancellable)
{
CamelMultipart *mp;
@@ -426,9 +426,9 @@ emf_parse_multipart_alternative (EMFormat *emf,
/* RFC 1740 */
static void
emf_parse_multipart_appledouble (EMFormat *emf,
- CamelMimePart *part,
+ CamelMimePart *part,
GString *part_id,
- EMFormatParserInfo *info,
+ EMFormatParserInfo *info,
GCancellable *cancellable)
{
CamelMultipart *mp;
@@ -545,10 +545,10 @@ emf_parse_multipart_encrypted (EMFormat *emf,
/* RFC 2046 */
static void
emf_parse_multipart_mixed (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable)
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable)
{
CamelMultipart *mp;
gint i, nparts, len;
@@ -578,10 +578,10 @@ emf_parse_multipart_mixed (EMFormat *emf,
static void
emf_parse_multipart_signed (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable)
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable)
{
CamelMimePart *cpart;
CamelMultipartSigned *mps;
@@ -685,10 +685,10 @@ emf_parse_multipart_signed (EMFormat *emf,
/* RFC 2046 */
static void
emf_parse_multipart_digest (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable)
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable)
{
CamelMultipart *mp;
gint i, nparts, len;
@@ -739,10 +739,10 @@ emf_parse_multipart_digest (EMFormat *emf,
/* RFC 2387 */
static void
emf_parse_multipart_related (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable)
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable)
{
CamelMultipart *mp;
CamelMimePart *body_part, *display_part = NULL;
@@ -786,10 +786,10 @@ emf_parse_multipart_related (EMFormat *emf,
static void
emf_parse_message_deliverystatus (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable)
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable)
{
EMFormatPURI *puri;
gint len;
@@ -813,8 +813,8 @@ emf_parse_message_deliverystatus (EMFormat *emf,
static void
emf_parse_inlinepgp_signed (EMFormat *emf,
- CamelMimePart *ipart,
- GString *part_id,
+ CamelMimePart *ipart,
+ GString *part_id,
EMFormatParserInfo *info,
GCancellable *cancellable)
{
@@ -1503,9 +1503,7 @@ em_format_init (EMFormat *emf)
EMFormat *
em_format_new (void)
{
- EMFormat *emf = g_object_new (EM_TYPE_FORMAT, NULL);
-
- return emf;
+ return g_object_new (EM_TYPE_FORMAT, NULL);
}
GType
@@ -1817,7 +1815,7 @@ em_format_find_puri (EMFormat *emf,
void
em_format_class_add_handler (EMFormatClass *emfc,
- EMFormatHandler *handler)
+ EMFormatHandler *handler)
{
EMFormatHandler *old_handler;
@@ -1940,7 +1938,8 @@ em_format_parse (EMFormat *emf,
emf->folder = g_object_ref (folder);
}
- /* Before the actual parsing starts, let child classes prepare themselves. */
+ /* Before the actual parsing starts,
+ * let child classes prepare themselves. */
if (EM_FORMAT_GET_CLASS (emf)->preparse)
EM_FORMAT_GET_CLASS (emf)->preparse (emf);
@@ -2041,8 +2040,9 @@ em_format_parse_part_as (EMFormat *emf,
.force_handler = 0
};
- /* Let everything that claims to be an attachment or inlined part to be parsed
- * as an attachment. The parser will decide how to display it. */
+ /* Let everything that claims to be an attachment or inlined
+ * part to be parsed as an attachment. The parser will decide
+ * how to display it. */
disposition = camel_mime_part_get_content_disposition (part);
if (!info->force_handler && disposition &&
(g_strcmp0 (disposition->disposition, "attachment") == 0)) {
@@ -2064,7 +2064,7 @@ em_format_parse_part_as (EMFormat *emf,
handler = em_format_find_handler (emf, "x-evolution/message/attachment");
ninfo.handler = handler;
- /* When this fails, something is probably very wrong...*/
+ /* When this fails, something is probably very wrong...*/
if (handler && handler->parse_func)
handler->parse_func (emf, part, part_id, &ninfo, cancellable);
}
diff --git a/em-format/em-format.h b/em-format/em-format.h
index d535ab2809..5ef50f42e3 100644
--- a/em-format/em-format.h
+++ b/em-format/em-format.h
@@ -118,8 +118,8 @@ struct _EMFormatParserInfo {
guint32 validity_type;
CamelCipherValidity *validity;
- gint is_attachment : 1;
- gint force_handler: 1;
+ gint is_attachment : 1;
+ gint force_handler: 1;
};
struct _EMFormatWriterInfo {
@@ -172,7 +172,7 @@ struct _EMFormat {
CamelMimeMessage *message;
CamelFolder *folder;
gchar *message_uid;
- gchar *uri_base;
+ gchar *uri_base;
/* Defines order in which parts should be displayed */
GList *mail_part_list;
@@ -188,163 +188,146 @@ struct _EMFormatClass {
GHashTable *type_handlers;
- gboolean (*is_inline) (EMFormat *emf,
- const gchar *part_id,
- CamelMimePart *part,
- const EMFormatHandler *handler);
+ gboolean (*is_inline) (EMFormat *emf,
+ const gchar *part_id,
+ CamelMimePart *part,
+ const EMFormatHandler *handler);
/* Write the entire message to stream */
- void (*write) (EMFormat *emf,
- CamelStream *stream,
- EMFormatWriterInfo *info,
- GCancellable *cancellable);
+ void (*write) (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatWriterInfo *info,
+ GCancellable *cancellable);
- void (*preparse) (EMFormat *emf);
+ void (*preparse) (EMFormat *emf);
/* signals */
- void (*redraw_requested) (EMFormat *emf);
+ void (*redraw_requested) (EMFormat *emf);
};
-EMFormat * em_format_new (void);
-
-GType em_format_get_type (void);
-
-void em_format_set_charset (EMFormat *emf,
- const gchar *charset);
-const gchar * em_format_get_charset (EMFormat *emf);
-
-void em_format_set_default_charset (EMFormat *emf,
- const gchar *charset);
-const gchar * em_format_get_default_charset (EMFormat *emf);
-
-void em_format_set_composer (EMFormat *emf,
- gboolean composer);
-gboolean em_format_get_composer (EMFormat *emf);
-
-CamelSession * em_format_get_session (EMFormat *emf);
-
-void em_format_set_base_url (EMFormat *emf,
- CamelURL *url);
-void em_format_set_base_url_string (EMFormat *emf,
- const gchar *url_string);
-CamelURL * em_format_get_base_url (EMFormat *emf);
-
-void em_format_clear_headers (EMFormat *emf);
-
-void em_format_default_headers (EMFormat *emf);
-
-void em_format_add_header (EMFormat *emf,
- const gchar *name,
- const gchar *value,
- guint32 flags);
-void em_format_add_header_struct (EMFormat *emf,
- EMFormatHeader *header);
-void em_format_remove_header (EMFormat *emf,
- const gchar *name,
- const gchar *value);
-void em_format_remove_header_struct (EMFormat *emf,
- const EMFormatHeader *header);
-
-void em_format_add_puri (EMFormat *emf,
- EMFormatPURI *puri);
-EMFormatPURI * em_format_find_puri (EMFormat *emf,
- const gchar *id);
-
-void em_format_class_add_handler (EMFormatClass *emfc,
- EMFormatHandler *handler);
-void em_format_class_remove_handler (EMFormatClass *emfc,
- EMFormatHandler *handler);
-
-const EMFormatHandler * em_format_find_handler (EMFormat *emf,
- const gchar *mime_type);
-const EMFormatHandler * em_format_fallback_handler (EMFormat *emf,
- const gchar *mime_type);
-
-void em_format_parse (EMFormat *emf,
- CamelMimeMessage *message,
- CamelFolder *folder,
- GCancellable *cancellable);
-
-void em_format_write (EMFormat *emf,
- CamelStream *stream,
- EMFormatWriterInfo *info,
- GCancellable *cancellable);
-
-void em_format_parse_async (EMFormat *emf,
- CamelMimeMessage *message,
- CamelFolder *folder,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-void em_format_parse_part (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable);
-void em_format_parse_part_as (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- const gchar *mime_type,
- GCancellable *cancellable);
-gboolean em_format_is_inline (EMFormat *emf,
- const gchar *part_id,
- CamelMimePart *part,
- const EMFormatHandler *handler);
-
-gchar * em_format_get_error_id (EMFormat *emf);
-
-void em_format_format_error (EMFormat *emf,
- const gchar *format,
- ...) G_GNUC_PRINTF (2, 3);
-void em_format_format_text (EMFormat *emf,
- CamelStream *stream,
- CamelDataWrapper *dw,
- GCancellable *cancellable);
-gchar * em_format_describe_part (CamelMimePart *part,
- const gchar *mime_type);
-gint em_format_is_attachment (EMFormat *emf,
- CamelMimePart *part);
-const gchar * em_format_snoop_type (CamelMimePart *part);
-
-gchar * em_format_build_mail_uri (CamelFolder *folder,
- const gchar *message_uid,
- const gchar *part_uid,
- ...) G_GNUC_NULL_TERMINATED;
+GType em_format_get_type (void);
+EMFormat * em_format_new (void);
+void em_format_set_charset (EMFormat *emf,
+ const gchar *charset);
+const gchar * em_format_get_charset (EMFormat *emf);
+const gchar * em_format_get_default_charset (EMFormat *emf);
+void em_format_set_default_charset (EMFormat *emf,
+ const gchar *charset);
+gboolean em_format_get_composer (EMFormat *emf);
+void em_format_set_composer (EMFormat *emf,
+ gboolean composer);
+CamelSession * em_format_get_session (EMFormat *emf);
+void em_format_set_base_url (EMFormat *emf,
+ CamelURL *url);
+void em_format_set_base_url_string (EMFormat *emf,
+ const gchar *url_string);
+CamelURL * em_format_get_base_url (EMFormat *emf);
+void em_format_clear_headers (EMFormat *emf);
+void em_format_default_headers (EMFormat *emf);
+void em_format_add_header (EMFormat *emf,
+ const gchar *name,
+ const gchar *value,
+ guint32 flags);
+void em_format_add_header_struct (EMFormat *emf,
+ EMFormatHeader *header);
+void em_format_remove_header (EMFormat *emf,
+ const gchar *name,
+ const gchar *value);
+void em_format_remove_header_struct (EMFormat *emf,
+ const EMFormatHeader *header);
+void em_format_add_puri (EMFormat *emf,
+ EMFormatPURI *puri);
+EMFormatPURI * em_format_find_puri (EMFormat *emf,
+ const gchar *id);
+void em_format_class_add_handler (EMFormatClass *emfc,
+ EMFormatHandler *handler);
+void em_format_class_remove_handler (EMFormatClass *emfc,
+ EMFormatHandler *handler);
+const EMFormatHandler *
+ em_format_find_handler (EMFormat *emf,
+ const gchar *mime_type);
+const EMFormatHandler *
+ em_format_fallback_handler (EMFormat *emf,
+ const gchar *mime_type);
+void em_format_parse (EMFormat *emf,
+ CamelMimeMessage *message,
+ CamelFolder *folder,
+ GCancellable *cancellable);
+void em_format_write (EMFormat *emf,
+ CamelStream *stream,
+ EMFormatWriterInfo *info,
+ GCancellable *cancellable);
+void em_format_parse_async (EMFormat *emf,
+ CamelMimeMessage *message,
+ CamelFolder *folder,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+void em_format_parse_part (EMFormat *emf,
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable);
+void em_format_parse_part_as (EMFormat *emf,
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ const gchar *mime_type,
+ GCancellable *cancellable);
+gboolean em_format_is_inline (EMFormat *emf,
+ const gchar *part_id,
+ CamelMimePart *part,
+ const EMFormatHandler *handler);
+gchar * em_format_get_error_id (EMFormat *emf);
+void em_format_format_error (EMFormat *emf,
+ const gchar *format,
+ ...) G_GNUC_PRINTF (2, 3);
+void em_format_format_text (EMFormat *emf,
+ CamelStream *stream,
+ CamelDataWrapper *dw,
+ GCancellable *cancellable);
+gchar * em_format_describe_part (CamelMimePart *part,
+ const gchar *mime_type);
+gint em_format_is_attachment (EMFormat *emf,
+ CamelMimePart *part);
+const gchar * em_format_snoop_type (CamelMimePart *part);
+gchar * em_format_build_mail_uri (CamelFolder *folder,
+ const gchar *message_uid,
+ const gchar *part_uid,
+ ...) G_GNUC_NULL_TERMINATED;
/* EMFormatParseFunc that does nothing. Use it to disable
* parsing of a specific mime type parts */
-void em_format_empty_parser (EMFormat *emf,
- CamelMimePart *part,
- GString *part_id,
- EMFormatParserInfo *info,
- GCancellable *cancellable);
+void em_format_empty_parser (EMFormat *emf,
+ CamelMimePart *part,
+ GString *part_id,
+ EMFormatParserInfo *info,
+ GCancellable *cancellable);
/* EMFormatWriteFunc that does nothing. Use it to disable
* writing of a specific mime type parts */
-void em_format_empty_writer (EMFormat *emf,
- EMFormatPURI *puri,
- CamelStream *stream,
- EMFormatWriterInfo *info,
- GCancellable *cancellable);
-
-void em_format_redraw (EMFormat *emf);
-
-EMFormatPURI * em_format_puri_new (EMFormat *emf,
- gsize puri_size,
- CamelMimePart *part,
- const gchar *uri);
-void em_format_puri_free (EMFormatPURI *puri);
+void em_format_empty_writer (EMFormat *emf,
+ EMFormatPURI *puri,
+ CamelStream *stream,
+ EMFormatWriterInfo *info,
+ GCancellable *cancellable);
-void em_format_puri_write (EMFormatPURI *puri,
- CamelStream *stream,
- EMFormatWriterInfo *info,
- GCancellable *cancellable);
+void em_format_redraw (EMFormat *emf);
-EMFormatHeader * em_format_header_new (const gchar *name,
- const gchar *value);
-void em_format_header_free (EMFormatHeader *header);
+EMFormatPURI * em_format_puri_new (EMFormat *emf,
+ gsize puri_size,
+ CamelMimePart *part,
+ const gchar *uri);
+void em_format_puri_free (EMFormatPURI *puri);
+void em_format_puri_write (EMFormatPURI *puri,
+ CamelStream *stream,
+ EMFormatWriterInfo *info,
+ GCancellable *cancellable);
+EMFormatHeader *
+ em_format_header_new (const gchar *name,
+ const gchar *value);
+void em_format_header_free (EMFormatHeader *header);
#endif /* EM_FORMAT_H */
+