diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-11-07 07:39:15 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-11-07 07:39:15 +0800 |
commit | d3eca1d96c1562aae0694d5071a0f57d5be56fe9 (patch) | |
tree | d9594a09cf487e77f0e5bf8f6256a2f93618899c /filter | |
parent | 94983782e69df5294669d2c033bb85cc7f379dbd (diff) | |
download | gsoc2013-evolution-d3eca1d96c1562aae0694d5071a0f57d5be56fe9.tar.gz gsoc2013-evolution-d3eca1d96c1562aae0694d5071a0f57d5be56fe9.tar.zst gsoc2013-evolution-d3eca1d96c1562aae0694d5071a0f57d5be56fe9.zip |
Deleted most of the internals until we devise a gconf schema and redesign
2002-11-06 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'filter')
-rw-r--r-- | filter/ChangeLog | 4 | ||||
-rw-r--r-- | filter/filter-label.c | 81 | ||||
-rw-r--r-- | filter/filter-label.h | 6 |
3 files changed, 13 insertions, 78 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index 36b530a988..a2bc43d55b 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -1,5 +1,9 @@ 2002-11-06 Jeffrey Stedfast <fejj@ximian.com> + * 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. + * filter.glade: Converted to the glade-2 format. 2002-11-05 Jeffrey Stedfast <fejj@ximian.com> 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 <string.h> #include <gtk/gtk.h> +#include <gconf/gconf.h> #include <libgnome/gnome-i18n.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-dialog-util.h> #include <libgnomeui/gnome-file-entry.h> -#include <bonobo/bonobo-object.h> -#include <bonobo/bonobo-generic-factory.h> -#include <bonobo/bonobo-context.h> -#include <bonobo/bonobo-moniker-util.h> -#include <bonobo/bonobo-exception.h> -#include <bonobo-conf/bonobo-config-database.h> - #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? */ } diff --git a/filter/filter-label.h b/filter/filter-label.h index c62f806fa0..bde83811ce 100644 --- a/filter/filter-label.h +++ b/filter/filter-label.h @@ -43,6 +43,7 @@ typedef struct _FilterLabelClass FilterLabelClass; struct _FilterLabel { FilterOption parent_object; + }; struct _FilterLabelClass { @@ -57,11 +58,6 @@ GType filter_label_get_type (void); FilterLabel *filter_label_new (void); -/* Sigh, this is a mess, but its cleaner than the original mess */ -int filter_label_count (void); -const char *filter_label_label (int i); -int filter_label_index (const char *label); - #ifdef __cplusplus } #endif /* __cplusplus */ |