From 3581bfb3efdbdd9747749db0ddfa55a728f96719 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 19 Dec 2001 15:19:33 +0000 Subject: go slow and clear the map if the last uri and the current uri do not match 2001-12-19 JP Rosevear * conduits/calendar/calendar-conduit.c (check_for_slow_setting): go slow and clear the map if the last uri and the current uri do not match (post_sync): save the last uri * conduits/calendar/calendar-conduit-config.h: handle a last uri config option * conduits/todo/todo-conduit-config.h: ditto * conduits/calendar/calendar-conduit.c (start_calendar_server): use the open_default_calendar method * conduits/todo/todo-conduit.c (start_calendar_server): same as above * cal-client/Makefile.am: link with bonobo conf * cal-client/cal-client.h: new protos * idl/evolution-calendar.idl: make sure open method raises appropriate exceptions * gui/e-itip-control.c (start_calendar_server): use cal_client_open_default_* calls * cal-client/cal-client.c (real_open_calendar): do the real work of loading (cal_client_open_calendar): use above (get_fall_back_uri): get the basic local uri (get_default_uri): get the default uri from the config db (cal_client_open_default_calendar): open the default uri or the fallback if the method is unsupported (cal_client_open_default_tasks): same for tasks svn path=/trunk/; revision=15179 --- calendar/gui/e-itip-control.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'calendar/gui/e-itip-control.c') diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index 18991630a0..229a90ae5d 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -184,7 +184,7 @@ start_calendar_server_cb (CalClient *cal_client, } static CalClient * -start_calendar_server (gchar *uri, gboolean tasks) +start_calendar_server (gboolean tasks) { CalClient *client; char *cal_uri; @@ -192,25 +192,17 @@ start_calendar_server (gchar *uri, gboolean tasks) client = cal_client_new (); - if (uri) - cal_uri = g_strdup (uri); - else { - if (tasks) - cal_uri = g_concat_dir_and_file ( - g_get_home_dir (), - "evolution/local/Tasks/tasks.ics"); - else - cal_uri = g_concat_dir_and_file ( - g_get_home_dir (), - "evolution/local/Calendar/calendar.ics"); - } - gtk_signal_connect (GTK_OBJECT (client), "cal_opened", start_calendar_server_cb, &success); - if (!cal_client_open_calendar (client, cal_uri, FALSE)) - return NULL; - + if (tasks) { + if (!cal_client_open_default_tasks (client, FALSE)) + goto error; + } else { + if (!cal_client_open_default_calendar (client, FALSE)) + goto error; + } + /* run a sub event loop to turn cal-client's async load notification into a synchronous call */ gtk_main (); @@ -218,6 +210,9 @@ start_calendar_server (gchar *uri, gboolean tasks) if (success) return client; + error: + gtk_object_unref (GTK_OBJECT (client)); + return NULL; } @@ -254,13 +249,11 @@ init (EItipControl *itip) #endif /* Get the cal clients */ - priv->event_client = start_calendar_server ( - calendar_config_get_default_uri (), FALSE); + priv->event_client = start_calendar_server (FALSE); if (priv->event_client == NULL) g_warning ("Unable to start calendar client"); - priv->task_client = start_calendar_server ( - calendar_config_get_default_tasks_uri (), FALSE); + priv->task_client = start_calendar_server (TRUE); if (priv->task_client == NULL) g_warning ("Unable to start calendar client"); -- cgit v1.2.3