From d3eca1d96c1562aae0694d5071a0f57d5be56fe9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 6 Nov 2002 23:39:15 +0000 Subject: Deleted most of the internals until we devise a gconf schema and redesign 2002-11-06 Jeffrey Stedfast * filter-label.c (xml_create): Deleted most of the internals until we devise a gconf schema and redesign how we want to do this. It didn't work correctly for 1.2 anyway. svn path=/trunk/; revision=18618 --- filter/filter-label.c | 81 +++++---------------------------------------------- 1 file changed, 8 insertions(+), 73 deletions(-) (limited to 'filter/filter-label.c') diff --git a/filter/filter-label.c b/filter/filter-label.c index 489a8df5cf..a39d6cb2eb 100644 --- a/filter/filter-label.c +++ b/filter/filter-label.c @@ -29,18 +29,12 @@ #include #include +#include #include #include #include #include -#include -#include -#include -#include -#include -#include - #include "filter-label.h" #include "e-util/e-sexp.h" @@ -103,7 +97,7 @@ filter_label_init (FilterLabel *fl) static void filter_label_finalise (GtkObject *obj) { - G_OBJECT_CLASS (parent_class)->finalize (obj); + G_OBJECT_CLASS (parent_class)->finalize (obj); } /** @@ -119,75 +113,16 @@ filter_label_new (void) return (FilterLabel *) g_object_new (FILTER_TYPE_LABEL, NULL, NULL); } -static struct { - char *path; - char *title; - char *value; -} labels[] = { - { "/Mail/Labels/label_0", N_("Important"), "important" }, - { "/Mail/Labels/label_1", N_("Work"), "work" }, - { "/Mail/Labels/label_2", N_("Personal"), "personal" }, - { "/Mail/Labels/label_3", N_("To Do"), "todo" }, - { "/Mail/Labels/label_4", N_("Later"), "later" }, -}; - -int -filter_label_count (void) -{ - return (sizeof (labels) / sizeof (labels[0])); -} - -const char * -filter_label_label (int i) -{ - if (i < 0 || i >= sizeof (labels) / sizeof (labels[0])) - return NULL; - else - return labels[i].value; -} - -int -filter_label_index (const char *label) -{ - int i; - - for (i = 0; i < sizeof (labels) / sizeof (labels[0]); i++) { - if (strcmp (labels[i].value, label) == 0) - return i; - } - - return -1; -} - static void xml_create (FilterElement *fe, xmlNodePtr node) { - FilterOption *fo = (FilterOption *)fe; - Bonobo_ConfigDatabase db; - CORBA_Environment ev; - int i; - - FILTER_ELEMENT_CLASS (parent_class)->xml_create (fe, node); + FilterOption *fo = (FilterOption *) fe; + GConfClient *gconf; + GSList *labels, *l; - CORBA_exception_init (&ev); - db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev); + FILTER_ELEMENT_CLASS (parent_class)->xml_create (fe, node); - if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) - db = CORBA_OBJECT_NIL; + gconf = gconf_client_get_default (); - CORBA_exception_free (&ev); - - for (i = 0; i < sizeof (labels) / sizeof (labels[0]); i++) { - const char *title; - char *btitle; - - if (db == CORBA_OBJECT_NIL - || (title = btitle = bonobo_config_get_string (db, labels[i].path, NULL)) == NULL) { - btitle = NULL; - title = _(labels[i].title); - } - - filter_option_add (fo, labels[i].value, title, NULL); - g_free (btitle); - } + /* FIXME: probably use gconf_client_get_list() here? */ } -- cgit v1.2.3