diff options
author | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-11-21 04:24:24 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-11-21 04:24:24 +0800 |
commit | 37cdfc6c84183613ed796cc218e60e78e07ddc0a (patch) | |
tree | 8218fa78c61a4e2d127e45b706c5506596fe40da /filter | |
parent | 83f24bfbbf99c544c9ee7ca909f8b40ba25b979c (diff) | |
download | gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar.gz gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar.zst gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.zip |
free the list data
svn path=/trunk/; revision=18862
Diffstat (limited to 'filter')
-rw-r--r-- | filter/filter-label.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/filter/filter-label.c b/filter/filter-label.c index bd83c32d90..adf8557f57 100644 --- a/filter/filter-label.c +++ b/filter/filter-label.c @@ -158,23 +158,20 @@ xml_create (FilterElement *fe, xmlNodePtr node) FilterOption *fo = (FilterOption *) fe; GConfClient *gconf; GSList *list, *l; - const char *p; - char *title; + char *title, *p; int i = 0; FILTER_ELEMENT_CLASS (parent_class)->xml_create (fe, node); gconf = gconf_client_get_default (); -#warning "do we have to free the list data returned from gconf_client_get_list() ???" + l = list = gconf_client_get_list (gconf, "/apps/evolution/mail/labels", GCONF_VALUE_STRING, NULL); - while (l != NULL && i < 5) { + while (l != NULL) { title = (char *) l->data; if ((p = strrchr (title, ':'))) - title = g_strndup (title, p - title); - else - title = g_strdup (title); + *p++ = '\0'; - filter_option_add (fo, labels[i++].value, title, NULL); + filter_option_add (fo, i < 5 ? labels[i++].value : (p ? p : "#ffffff"), title, NULL); g_free (title); l = l->next; |