From c4071b0a1d38a478d3ba51c81af222cdeb4ed4fd Mon Sep 17 00:00:00 2001 From: Dan Vrátil Date: Fri, 8 Jun 2012 16:09:53 +0200 Subject: Fix displayed message headers The new formatter was ignoring selected headers, always displaying only From, To, Subject and Date (default headers). Handling of the currently displayed headers has been moved to EMailConfigFormatHTML extension, because it is related to configuration of EMailFormatter, rather then EMailReader. --- em-format/e-mail-formatter.c | 20 ++++++++++++++++++++ em-format/e-mail-formatter.h | 2 ++ 2 files changed, 22 insertions(+) (limited to 'em-format') diff --git a/em-format/e-mail-formatter.c b/em-format/e-mail-formatter.c index a08504a21f..0c8a0e7068 100644 --- a/em-format/e-mail-formatter.c +++ b/em-format/e-mail-formatter.c @@ -72,6 +72,13 @@ enum { PROP_DEFAULT_CHARSET }; +enum { + NEED_REDRAW, + LAST_SIGNAL +}; + +static int signals[LAST_SIGNAL]; + static void mail_formatter_run (EMailFormatter *formatter, EMailFormatterContext *context, @@ -492,6 +499,7 @@ e_mail_formatter_base_init (EMailFormatterClass *klass) CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES | + CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES | CAMEL_MIME_FILTER_TOHTML_MARK_CITATION; } @@ -691,6 +699,16 @@ e_mail_formatter_class_init (EMailFormatterClass *klass) NULL, NULL, G_PARAM_READWRITE)); + + signals[NEED_REDRAW] = g_signal_new ( + "need-redraw", + E_TYPE_MAIL_FORMATTER, + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (EMailFormatterClass, need_redraw), + NULL, + NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0, NULL); } static void @@ -1414,6 +1432,8 @@ e_mail_formatter_add_header (EMailFormatter *formatter, h = e_mail_formatter_header_new (name, value); h->flags = flags; g_queue_push_tail (formatter->priv->header_list, h); + + g_signal_emit (formatter, signals[NEED_REDRAW], 0, NULL); } void diff --git a/em-format/e-mail-formatter.h b/em-format/e-mail-formatter.h index aea18439b2..c0c21c13b0 100644 --- a/em-format/e-mail-formatter.h +++ b/em-format/e-mail-formatter.h @@ -126,6 +126,8 @@ struct _EMailFormatterClass { GtkStyle *style, GtkStateType state); + /* Signals */ + void (*need_redraw) (EMailFormatter *formatter); }; GType e_mail_formatter_get_type (void); -- cgit