aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-02-18 22:13:06 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:36 +0800
commit333ccc8abf033453996e4a7e16712f2fc3b9e05a (patch)
tree502950095b960e5785405e6fe24033d105ec4a45 /e-util
parentcb4f089f51ea643df81930db232fa45f8c32d66b (diff)
downloadgsoc2013-evolution-333ccc8abf033453996e4a7e16712f2fc3b9e05a.tar
gsoc2013-evolution-333ccc8abf033453996e4a7e16712f2fc3b9e05a.tar.gz
gsoc2013-evolution-333ccc8abf033453996e4a7e16712f2fc3b9e05a.tar.bz2
gsoc2013-evolution-333ccc8abf033453996e4a7e16712f2fc3b9e05a.tar.lz
gsoc2013-evolution-333ccc8abf033453996e4a7e16712f2fc3b9e05a.tar.xz
gsoc2013-evolution-333ccc8abf033453996e4a7e16712f2fc3b9e05a.tar.zst
gsoc2013-evolution-333ccc8abf033453996e4a7e16712f2fc3b9e05a.zip
Bug #639483 - Category list includes weather information
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-util.c34
-rw-r--r--e-util/e-util.h1
2 files changed, 34 insertions, 1 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 88fcfaebfb..8f91558823 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -1457,7 +1457,12 @@ e_util_get_category_filter_options (void)
clist = e_categories_get_list ();
for (l = clist; l; l = l->next) {
const gchar *cname = l->data;
- struct _filter_option *fo = g_new0 (struct _filter_option, 1);
+ struct _filter_option *fo;
+
+ if (!e_categories_is_searchable (cname))
+ continue;
+
+ fo = g_new0 (struct _filter_option, 1);
fo->title = g_strdup (cname);
fo->value = g_strdup (cname);
@@ -1470,6 +1475,33 @@ e_util_get_category_filter_options (void)
}
/**
+ * e_util_get_searchable_categories:
+ *
+ * Returns list of searchable categories only. The list should
+ * be freed with g_list_free() when done with it, but the items
+ * are internal strings, names of categories, which should not
+ * be touched in other than read-only way, in other words the same
+ * restrictions as for e_categories_get_list() applies here too.
+ **/
+GList *
+e_util_get_searchable_categories (void)
+{
+ GList *res = NULL, *all_categories, *l;
+
+ all_categories = e_categories_get_list ();
+ for (l = all_categories; l; l = l->next) {
+ const gchar *cname = l->data;
+
+ if (e_categories_is_searchable (cname))
+ res = g_list_prepend (res, (gpointer) cname);
+ }
+
+ g_list_free (all_categories);
+
+ return g_list_reverse (res);
+}
+
+/**
* e_util_set_source_combo_box_list:
* @source_combo_box: an #ESourceComboBox
* @source_gconf_path: GConf path with sources to use in an #ESourceList
diff --git a/e-util/e-util.h b/e-util/e-util.h
index 6560481f06..2c1cc8ea5e 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -140,6 +140,7 @@ gchar * e_util_guess_mime_type (const gchar *filename,
GSList * e_util_get_category_filter_options
(void);
+GList * e_util_get_searchable_categories(void);
void e_util_set_source_combo_box_list
(GtkWidget *source_combo_box,