aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/itip-utils.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-10-23 00:43:05 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-10-23 00:43:05 +0800
commit731caf5eb269c46696c1cacf63a8e088d0464d93 (patch)
tree2906f2ec48f1a252fe9983ea1f07dee8f35b4f22 /calendar/gui/itip-utils.c
parentbcb4183d7fac8fd40465838ef0728101f04e6811 (diff)
downloadgsoc2013-evolution-731caf5eb269c46696c1cacf63a8e088d0464d93.tar
gsoc2013-evolution-731caf5eb269c46696c1cacf63a8e088d0464d93.tar.gz
gsoc2013-evolution-731caf5eb269c46696c1cacf63a8e088d0464d93.tar.bz2
gsoc2013-evolution-731caf5eb269c46696c1cacf63a8e088d0464d93.tar.lz
gsoc2013-evolution-731caf5eb269c46696c1cacf63a8e088d0464d93.tar.xz
gsoc2013-evolution-731caf5eb269c46696c1cacf63a8e088d0464d93.tar.zst
gsoc2013-evolution-731caf5eb269c46696c1cacf63a8e088d0464d93.zip
use e_config_listener_* to get values (itip_addresses_get): ditto
2002-10-22 JP Rosevear <jpr@ximian.com> * gui/itip-utils.c (get_address): use e_config_listener_* to get values (itip_addresses_get): ditto (itip_addresses_get_default): ditto * gui/calendar-model.c (calendar_model_value_to_string): don't send back a null string (affects if it is the group header) (calendar_model_init): pre load config database info so we don't do corba calls during draws svn path=/trunk/; revision=18410
Diffstat (limited to 'calendar/gui/itip-utils.c')
-rw-r--r--calendar/gui/itip-utils.c47
1 files changed, 11 insertions, 36 deletions
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index b3e18422af..76e23e47f1 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -39,6 +39,7 @@
#include <ical.h>
#include <Evolution-Composer.h>
#include <e-util/e-time-utils.h>
+#include <e-util/e-config-listener.h>
#include <cal-util/timeutil.h>
#include <cal-util/cal-util.h>
#include "calendar-config.h"
@@ -68,7 +69,7 @@ static icalproperty_method itip_methods_enum[] = {
ICAL_METHOD_DECLINECOUNTER,
};
-static Bonobo_ConfigDatabase db = NULL;
+static EConfigListener *config = NULL;
static ItipAddress *
get_address (long num)
@@ -80,11 +81,11 @@ get_address (long num)
/* get the identity info */
path = g_strdup_printf ("/Mail/Accounts/identity_name_%ld", num);
- a->name = bonobo_config_get_string (db, path, NULL);
+ a->name = e_config_listener_get_string_with_default (config, path, NULL, NULL);
g_free (path);
path = g_strdup_printf ("/Mail/Accounts/identity_address_%ld", num);
- a->address = bonobo_config_get_string (db, path, NULL);
+ a->address = e_config_listener_get_string_with_default (config, path, NULL, NULL);
a->address = g_strstrip (a->address);
g_free (path);
@@ -96,28 +97,14 @@ get_address (long num)
GList *
itip_addresses_get (void)
{
-
- CORBA_Environment ev;
GList *addresses = NULL;
glong len, def, i;
- if (db == NULL) {
- CORBA_exception_init (&ev);
-
- db = bonobo_get_object ("wombat:",
- "Bonobo/ConfigDatabase",
- &ev);
-
- if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- CORBA_exception_free (&ev);
- }
+ if (config == NULL)
+ config = e_config_listener_new ();
- len = bonobo_config_get_long_with_default (db, "/Mail/Accounts/num", 0, NULL);
- def = bonobo_config_get_long_with_default (db, "/Mail/Accounts/default_account", 0, NULL);
+ len = e_config_listener_get_long_with_default (config, "/Mail/Accounts/num", 0, NULL);
+ def = e_config_listener_get_long_with_default (config, "/Mail/Accounts/default_account", 0, NULL);
for (i = 0; i < len; i++) {
ItipAddress *a;
@@ -135,26 +122,14 @@ itip_addresses_get (void)
ItipAddress *
itip_addresses_get_default (void)
{
- CORBA_Environment ev;
ItipAddress *a;
glong def;
- if (db == NULL) {
- CORBA_exception_init (&ev);
-
- db = bonobo_get_object ("wombat:",
- "Bonobo/ConfigDatabase",
- &ev);
+ if (config == NULL)
+ config = e_config_listener_new ();
- if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
- CORBA_exception_free (&ev);
- return NULL;
- }
-
- CORBA_exception_free (&ev);
- }
+ def = e_config_listener_get_long_with_default (config, "/Mail/Accounts/default_account", 0, NULL);
- def = bonobo_config_get_long_with_default (db, "/Mail/Accounts/default_account", 0, NULL);
a = get_address (def);
a->default_address = TRUE;