aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
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
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')
-rw-r--r--calendar/ChangeLog11
-rw-r--r--calendar/gui/calendar-model.c8
-rw-r--r--calendar/gui/itip-utils.c47
3 files changed, 29 insertions, 37 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 15f30724b0..e02fe5eea4 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,14 @@
+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
+
2002-10-17 JP Rosevear <jpr@ximian.com>
* gui/gnome-cal.c (gnome_calendar_construct): fix c/p type
diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c
index cef066c1b1..83448d01f8 100644
--- a/calendar/gui/calendar-model.c
+++ b/calendar/gui/calendar-model.c
@@ -239,6 +239,12 @@ calendar_model_init (CalendarModel *model)
priv->zone = NULL;
priv->activity = NULL;
+
+ /* Preload here, to avoid corba calls later */
+ /* Gross hack because gnome-canvas is not re-entrant */
+ calendar_config_get_tasks_due_today_color ();
+ calendar_config_get_tasks_overdue_color ();
+ g_free (calendar_config_get_hide_completed_tasks_sexp ());
}
static void
@@ -1732,7 +1738,7 @@ calendar_model_value_to_string (ETableModel *etm, int col, const void *value)
case CAL_COMPONENT_FIELD_PERCENT:
if (GPOINTER_TO_INT (value) < 0)
- return NULL;
+ return g_strdup ("N/A");
else
return g_strdup_printf ("%i%%", GPOINTER_TO_INT (value));
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;