diff options
author | Milan Crha <mcrha@redhat.com> | 2008-12-06 03:20:28 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-12-06 03:20:28 +0800 |
commit | 7b221ebc07a7867c3528b113e82f25a01816a015 (patch) | |
tree | 975f1efd25565d3fd930c935fabeb10ec5b866da /e-util | |
parent | 888965285486dbe274238c1b6062ed89986676a8 (diff) | |
download | gsoc2013-evolution-7b221ebc07a7867c3528b113e82f25a01816a015.tar gsoc2013-evolution-7b221ebc07a7867c3528b113e82f25a01816a015.tar.gz gsoc2013-evolution-7b221ebc07a7867c3528b113e82f25a01816a015.tar.bz2 gsoc2013-evolution-7b221ebc07a7867c3528b113e82f25a01816a015.tar.lz gsoc2013-evolution-7b221ebc07a7867c3528b113e82f25a01816a015.tar.xz gsoc2013-evolution-7b221ebc07a7867c3528b113e82f25a01816a015.tar.zst gsoc2013-evolution-7b221ebc07a7867c3528b113e82f25a01816a015.zip |
** Fix for bug #332629
2008-12-05 Milan Crha <mcrha@redhat.com>
** 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
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/ChangeLog | 8 | ||||
-rw-r--r-- | e-util/e-util.c | 22 | ||||
-rw-r--r-- | e-util/e-util.h | 2 |
3 files changed, 32 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog index d9701d49b3..18ab054e84 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,11 @@ +2008-12-05 Milan Crha <mcrha@redhat.com> + + ** Part of fix for bug #332629 + + * e-util.h: (e_util_get_category_filter_options): + * e-util.c: (e_util_get_category_filter_options): + New helper function to be used in FilterOption. + 2008-11-27 Milan Crha <mcrha@redhat.com> ** Fix for bug #332729 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 <libedataserver/e-data-server-util.h> +#include <libedataserver/e-categories.h> +#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); +} diff --git a/e-util/e-util.h b/e-util/e-util.h index b6ff33429d..a27602848c 100644 --- a/e-util/e-util.h +++ b/e-util/e-util.h @@ -125,6 +125,8 @@ gboolean e_util_read_file (const gchar *filename, gsize *read, GError **error); +GSList *e_util_get_category_filter_options (void); + G_END_DECLS #endif /* _E_UTIL_H_ */ |