aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-calendar.c
diff options
context:
space:
mode:
Diffstat (limited to 'my-evolution/e-summary-calendar.c')
-rw-r--r--my-evolution/e-summary-calendar.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/my-evolution/e-summary-calendar.c b/my-evolution/e-summary-calendar.c
index c4640f0a62..7de4e6a545 100644
--- a/my-evolution/e-summary-calendar.c
+++ b/my-evolution/e-summary-calendar.c
@@ -487,6 +487,7 @@ e_summary_calendar_init (ESummary *summary)
ESummaryCalendar *calendar;
gboolean result;
char *uri;
+ char *default_uri;
g_return_if_fail (summary != NULL);
@@ -494,8 +495,19 @@ e_summary_calendar_init (ESummary *summary)
summary->calendar = calendar;
calendar->html = 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);
+ g_warning ("Error getting Wombat. Using defaults");
+ return;
+ }
+
+ CORBA_exception_free (&ev);
+
calendar->client = cal_client_new ();
if (calendar->client == NULL) {
+ bonobo_object_release_unref (db, NULL);
g_warning ("Error making the client");
return;
}
@@ -507,7 +519,12 @@ e_summary_calendar_init (ESummary *summary)
gtk_signal_connect (GTK_OBJECT (calendar->client), "obj-removed",
GTK_SIGNAL_FUNC (obj_changed_cb), summary);
- uri = gnome_util_prepend_user_home ("evolution/local/Calendar/calendar.ics");
+ default_uri = bonobo_config_get_string (db, "/Calendar/DefaultUri", NULL);
+ if (!default_uri)
+ uri = gnome_util_prepend_user_home ("evolution/local/Calendar/calendar.ics");
+ else
+ uri = g_strdup (default_uri);
+
result = cal_client_open_calendar (calendar->client, uri, FALSE);
g_free (uri);
if (result == FALSE) {
@@ -515,18 +532,9 @@ e_summary_calendar_init (ESummary *summary)
}
e_summary_add_protocol_listener (summary, "calendar", e_summary_calendar_protocol, calendar);
-
- CORBA_exception_init (&ev);
- db = bonobo_get_object ("wombat:", "Bonobo/ConfigDatabase", &ev);
- if (BONOBO_EX (&ev) || db == CORBA_OBJECT_NIL) {
- CORBA_exception_free (&ev);
- g_warning ("Error getting Wombat. Using defaults");
- return;
- }
calendar->wants24hr = bonobo_config_get_boolean_with_default (db, "/Calendar/Display/Use24HourFormat", locale_uses_24h_time_format (), NULL);
bonobo_object_release_unref (db, NULL);
- CORBA_exception_free (&ev);
}
void