From 7b221ebc07a7867c3528b113e82f25a01816a015 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 5 Dec 2008 19:20:28 +0000 Subject: ** Fix for bug #332629 2008-12-05 Milan Crha ** Fix for bug #332629 * filter/filter-option.h: (struct _filter_option), (struct _FilterOption), (filter_option_add): * filter/filter-option.c: (filter_option_init), (filter_option_finalise), (filter_option_add), (xml_create), (get_widget), (clone): Be able to define optionlist with dynamically created list of options. * filter/filter-label.c: (fill_options): Adapt. * addressbook/gui/widgets/addresstypes.xml: * calendar/gui/caltypes.xml: * calendar/gui/memotypes.xml: * calendar/gui/tasktypes.xml: Use dynamically created list of categories in the option's widget. svn path=/trunk/; revision=36836 --- e-util/e-util.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'e-util/e-util.c') diff --git a/e-util/e-util.c b/e-util/e-util.c index f05c9d907a..215a494df9 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -46,6 +46,8 @@ #endif #include +#include +#include "filter/filter-option.h" #include "e-util.h" #include "e-util-private.h" @@ -1224,3 +1226,23 @@ e_util_read_file (const char *filename, gboolean filename_is_uri, char **buffer, return res; } +GSList * +e_util_get_category_filter_options (void) +{ + GSList *res = NULL; + GList *clist, *l; + + clist = e_categories_get_list (); + for (l = clist; l; l = l->next) { + const char *cname = l->data; + struct _filter_option *fo = g_new0 (struct _filter_option, 1); + + fo->title = g_strdup (cname); + fo->value = g_strdup (cname); + res = g_slist_prepend (res, fo); + } + + g_list_free (clist); + + return g_slist_reverse (res); +} -- cgit