aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util-labels.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-05-26 01:42:03 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-05-26 01:42:03 +0800
commita6c9a55391c484038a98f0326798949c52621c50 (patch)
tree75930134509017a72cc9025f48ad81bd6693654d /e-util/e-util-labels.c
parent949c01ec2e00fd178c5ee0307191fa130ab6aa74 (diff)
downloadgsoc2013-evolution-a6c9a55391c484038a98f0326798949c52621c50.tar.gz
gsoc2013-evolution-a6c9a55391c484038a98f0326798949c52621c50.tar.zst
gsoc2013-evolution-a6c9a55391c484038a98f0326798949c52621c50.zip
Fix compiler warnings in e-util.
Diffstat (limited to 'e-util/e-util-labels.c')
-rw-r--r--e-util/e-util-labels.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/e-util/e-util-labels.c b/e-util/e-util-labels.c
index 85984da59c..a7d5913bbd 100644
--- a/e-util/e-util-labels.c
+++ b/e-util/e-util-labels.c
@@ -34,8 +34,14 @@
#include "e-dialog-utils.h"
#include "filter/filter-option.h"
-/* Note, the first element of each EUtilLabel must NOT be translated */
-EUtilLabel label_defaults[LABEL_DEFAULTS_NUM] = {
+typedef struct {
+ const gchar *tag;
+ const gchar *name;
+ const gchar *colour;
+} DefaultLabel;
+
+/* Note, the first element of each DefaultLabel must NOT be translated */
+DefaultLabel label_defaults[] = {
{ "$Labelimportant", N_("I_mportant"), "#EF2929" }, /* red */
{ "$Labelwork", N_("_Work"), "#F57900" }, /* orange */
{ "$Labelpersonal", N_("_Personal"), "#4E9A06" }, /* green */
@@ -84,7 +90,7 @@ e_util_labels_parse (GConfClient *client)
label = g_new (EUtilLabel, 1);
/* Needed for Backward Compatibility */
- if (num < LABEL_DEFAULTS_NUM) {
+ if (num < G_N_ELEMENTS (label_defaults)) {
label->name = g_strdup ((buf && *buf) ? buf : _(label_defaults[num].name));
label->tag = g_strdup (label_defaults[num].tag);
num++;
@@ -106,7 +112,7 @@ e_util_labels_parse (GConfClient *client)
if (head)
g_slist_free (head);
- while (num < LABEL_DEFAULTS_NUM) {
+ while (num < G_N_ELEMENTS (label_defaults)) {
/* complete the list with defaults */
label = g_new (EUtilLabel, 1);
label->tag = g_strdup (label_defaults[num].tag);
@@ -452,7 +458,7 @@ e_util_labels_is_system (const char *tag)
if (!tag)
return FALSE;
- for (i = 0; i < LABEL_DEFAULTS_NUM; i++) {
+ for (i = 0; i < G_N_ELEMENTS (label_defaults); i++) {
if (strcmp (tag, label_defaults[i].tag) == 0)
return TRUE;
}
@@ -474,7 +480,7 @@ e_util_labels_get_new_tag (const char *old_tag)
if (!old_tag)
return NULL;
- for (i = 0; i < LABEL_DEFAULTS_NUM; i++) {
+ for (i = 0; i < G_N_ELEMENTS (label_defaults); i++) {
/* default labels have same name as those old, only with prefix "$Label" */
if (!strcmp (old_tag, label_defaults[i].tag + 6))
return label_defaults[i].tag;