From 42e8edbe5c6bbb0ea247f256e113a07949432017 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 9 Jan 2002 23:34:45 +0000 Subject: Fixed the setup of the "save-draft" signal so that it would actually work. 2002-01-09 Jeffrey Stedfast * e-msg-composer.c (class_init): Fixed the setup of the "save-draft" signal so that it would actually work. svn path=/trunk/; revision=15279 --- composer/ChangeLog | 12 ++++++++++++ composer/e-msg-composer.c | 49 +++++++++++------------------------------------ 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/composer/ChangeLog b/composer/ChangeLog index cdbf338f25..b0b891e5e9 100644 --- a/composer/ChangeLog +++ b/composer/ChangeLog @@ -1,3 +1,15 @@ +2002-01-09 Jeffrey Stedfast + + * e-msg-composer.c (class_init): Fixed the setup of the + "save-draft" signal so that it would actually work. + +2002-01-08 Jeffrey Stedfast + + * e-msg-composer.c (is_special_header): Greatly simplified. No + need to have a list of headers to not accept - we can just refuse + all headers that are not X-* headers (other than X-Evolution + headers). + 2002-01-07 Jeffrey Stedfast * e-msg-composer.c (e_msg_composer_get_message_draft): Set the diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 5c8cb768d3..485e73001a 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -2181,7 +2181,7 @@ class_init (EMsgComposerClass *klass) object_class->type, GTK_SIGNAL_OFFSET (EMsgComposerClass, save_draft), marshal_NONE__NONE_INT, - GTK_TYPE_NONE, 1); + GTK_TYPE_NONE, 1, GTK_TYPE_INT); gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL); } @@ -2509,47 +2509,20 @@ e_msg_composer_new (void) return new; } - -/* FIXME: are there any other headers?? */ -/* This is a list of headers that we DO NOT want to append to the - * extra_hdr_* arrays. - * - * Note: a '*' char can be used for a simple wilcard match. - * is_special_header() will use g_strNcasecmp() with the first '*' - * char being the end of the match string. If no '*' is present, then - * it will be assumed that the header must be an exact match. - */ -static char *special_headers[] = { - "Subject", - "Date", - "From", - "To", - "Cc", - "Bcc", - "Received", - "Message-Id", - "X-Evolution*", - "Content-*", - "MIME-Version", - NULL -}; - static gboolean is_special_header (const char *hdr_name) { - int i; + /* Note: a header is a "special header" if it has any meaning: + 1. it's not a X-* header or + 2. it's an X-Evolution* header + */ + if (g_strncasecmp (hdr_name, "X-", 2)) + return TRUE; - for (i = 0; special_headers[i]; i++) { - char *p; - - if ((p = strchr (special_headers[i], '*'))) { - if (!g_strncasecmp (special_headers[i], hdr_name, p - special_headers[i])) - return TRUE; - } else { - if (!g_strcasecmp (special_headers[i], hdr_name)) - return TRUE; - } - } + if (!g_strncasecmp (hdr_name, "X-Evolution", 11)) + return TRUE; + + /* we can keep all other X-* headers */ return FALSE; } -- cgit v1.2.3