aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-04-30 02:18:36 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-04-30 02:18:36 +0800
commit36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb (patch)
tree82c8b4119a34f41f83ab74f8e6ad3e6740cf7e36 /mail/mail-config.c
parent693f508f977206eee187539e3fce3bf8cb1f4311 (diff)
downloadgsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.tar
gsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.tar.gz
gsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.tar.bz2
gsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.tar.lz
gsoc2013-evolution-36b97dcf5dc8c0346ec5a389c8be7f1bd15de3bb.tar.xz
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
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c19
1 files changed, 11 insertions, 8 deletions
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;
}