aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2002-11-21 04:24:24 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-21 04:24:24 +0800
commit37cdfc6c84183613ed796cc218e60e78e07ddc0a (patch)
tree8218fa78c61a4e2d127e45b706c5506596fe40da
parent83f24bfbbf99c544c9ee7ca909f8b40ba25b979c (diff)
downloadgsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar
gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar.gz
gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar.bz2
gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar.lz
gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar.xz
gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.tar.zst
gsoc2013-evolution-37cdfc6c84183613ed796cc218e60e78e07ddc0a.zip
free the list data
svn path=/trunk/; revision=18862
-rw-r--r--filter/filter-label.c13
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;