diff options
author | Not Zed <NotZed@Ximian.com> | 2003-04-30 02:18:36 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2003-04-30 02:18:36 +0800 |
commit | 36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb (patch) | |
tree | 82c8b4119a34f41f83ab74f8e6ad3e6740cf7e36 | |
parent | 693f508f977206eee187539e3fce3bf8cb1f4311 (diff) | |
download | gsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.tar.gz gsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.tar.zst gsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.zip |
** See bug #41972
2003-04-29 Not Zed <NotZed@Ximian.com>
** See bug #41972
* message-list.c (ml_tree_value_at): fix (void *) casts on trinary
ops.
* folder-browser.c (on_right_click): Store the label tag in the
label callback data, not the translated name.
* mail-config.c (label_defaults[]): Initialise with the tag
values.
(config_clear_labels): free tag field.
(config_cache_labels): setup the tag field based on the position
of the label name.
(mail_config_get_label_color_by_name): Lookup colour by the
untranslated TAG, not the translated/customisable tag.
* mail-config.h (MailConfigLabel): Add a tag field, we were using
the translated name as the label(!).
svn path=/trunk/; revision=21008
-rw-r--r-- | mail/ChangeLog | 25 | ||||
-rw-r--r-- | mail/folder-browser.c | 2 | ||||
-rw-r--r-- | mail/mail-config.c | 19 | ||||
-rw-r--r-- | mail/mail-config.h | 1 | ||||
-rw-r--r-- | mail/message-list.c | 8 |
5 files changed, 41 insertions, 14 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 1151617a24..45b5280e8b 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,24 @@ +2003-04-29 Not Zed <NotZed@Ximian.com> + + ** See bug #41972 + + * message-list.c (ml_tree_value_at): fix (void *) casts on trinary + ops. + + * folder-browser.c (on_right_click): Store the label tag in the + label callback data, not the translated name. + + * mail-config.c (label_defaults[]): Initialise with the tag + values. + (config_clear_labels): free tag field. + (config_cache_labels): setup the tag field based on the position + of the label name. + (mail_config_get_label_color_by_name): Lookup colour by the + untranslated TAG, not the translated/customisable tag. + + * mail-config.h (MailConfigLabel): Add a tag field, we were using + the translated name as the label(!). + 2003-04-29 Dan Winship <danw@ximian.com> * mail-format.c (write_xmailer_header): Remove preceding whitespace @@ -17,6 +38,8 @@ 2003-04-24 Jeffrey Stedfast <fejj@ximian.com> + Fix for bug #41789 + * mail-config.c (mail_config_init): Cache the allowable mime-types. (mail_config_get_allowable_mime_types): New public function to get @@ -71,7 +94,7 @@ * message-browser.c: Use PREFIX instead of EVOLUTION_DATADIR for bonobo_ui_util_set_ui (). Fixes bug #21499. - + 2003-04-17 Not Zed <NotZed@Ximian.com> * mail-signature-editor.c (menu_help): remove the help menu item diff --git a/mail/folder-browser.c b/mail/folder-browser.c index e163ffc952..29a59cbc11 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -2099,7 +2099,7 @@ on_right_click (ETree *tree, gint row, ETreePath path, gint col, GdkEvent *event closure = g_new (struct _label_data, 1); g_object_ref (fb); closure->fb = fb; - closure->label = label->name; + closure->label = label->tag; g_ptr_array_add (closures, closure); diff --git a/mail/mail-config.c b/mail/mail-config.c index 358a2c9aac..32a1226012 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -63,13 +63,13 @@ #include "Mailer.h" - +/* Note, the first element of each MailConfigLabel must NOT be translated */ MailConfigLabel label_defaults[5] = { - { N_("Important"), "#ff0000" }, /* red */ - { N_("Work"), "#ff8c00" }, /* orange */ - { N_("Personal"), "#008b00" }, /* forest green */ - { N_("To Do"), "#0000ff" }, /* blue */ - { N_("Later"), "#8b008b" } /* magenta */ + { "important", N_("Important"), "#ff0000" }, /* red */ + { "work", N_("Work"), "#ff8c00" }, /* orange */ + { "personal", N_("Personal"), "#008b00" }, /* forest green */ + { "todo", N_("To Do"), "#0000ff" }, /* blue */ + { "later", N_("Later"), "#8b008b" } /* magenta */ }; typedef struct { @@ -320,6 +320,7 @@ config_clear_labels (void) list = config->labels; while (list != NULL) { label = list->data; + g_free(label->tag); g_free (label->name); g_free (label->colour); g_free (label); @@ -347,10 +348,11 @@ config_cache_labels (void) while (list != NULL) { buf = list->data; - if ((colour = strrchr (buf, ':'))) { + if (num < 5 && (colour = strrchr (buf, ':'))) { label = g_new (MailConfigLabel, 1); *colour++ = '\0'; + label->tag = g_strdup(label_defaults[num].tag); label->name = g_strdup (buf); label->colour = g_strdup (colour); @@ -378,6 +380,7 @@ config_cache_labels (void) while (num < 5) { /* complete the list with defaults */ label = g_new (MailConfigLabel, 1); + label->tag = g_strdup (label_defaults[num].tag); label->name = g_strdup (_(label_defaults[num].name)); label->colour = g_strdup (label_defaults[num].colour); @@ -665,7 +668,7 @@ mail_config_get_label_color_by_name (const char *name) node = config->labels; while (node != NULL) { label = node->data; - if (!strcmp (label->name, name)) + if (!strcmp (label->tag, name)) return label->colour; node = node->next; } diff --git a/mail/mail-config.h b/mail/mail-config.h index 3abc9588f8..d0f5cb138b 100644 --- a/mail/mail-config.h +++ b/mail/mail-config.h @@ -82,6 +82,7 @@ typedef enum { } MailConfigXMailerDisplayStyle; typedef struct { + char *tag; char *name; char *colour; } MailConfigLabel; diff --git a/mail/message-list.c b/mail/message-list.c index 631b5b5519..3c1dd7e9f7 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -950,17 +950,17 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) } case COL_FOLLOWUP_FLAG: str = camel_tag_get ((CamelTag **) &msg_info->user_tags, "follow-up"); - return (void *) str ? str : ""; + return (void *)(str ? str : ""); case COL_ATTACHMENT: return GINT_TO_POINTER ((msg_info->flags & CAMEL_MESSAGE_ATTACHMENTS) != 0); case COL_FROM: str = camel_message_info_from (msg_info); - return (void *) str ? str : ""; + return (void *)(str ? str : ""); case COL_FROM_NORM: return (void *) get_normalised_string (message_list, msg_info, col); case COL_SUBJECT: str = camel_message_info_subject (msg_info); - return (void *) str ? str : ""; + return (void *)(str ? str : ""); case COL_SUBJECT_NORM: return (void *) get_normalised_string (message_list, msg_info, col); case COL_SENT: @@ -969,7 +969,7 @@ ml_tree_value_at (ETreeModel *etm, ETreePath path, int col, void *model_data) return GINT_TO_POINTER (msg_info->date_received); case COL_TO: str = camel_message_info_to (msg_info); - return (void *) str ? str : ""; + return (void *)(str ? str : ""); case COL_TO_NORM: return (void *) get_normalised_string (message_list, msg_info, col); case COL_SIZE: |