aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-12-19 23:19:33 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-12-19 23:19:33 +0800
commit3581bfb3efdbdd9747749db0ddfa55a728f96719 (patch)
tree342c922938c70cfe2e579fe2f3f6694b97515620 /calendar/gui
parentb64f547cdd71098035e9b055ee7f0ec4de2b9e1c (diff)
downloadgsoc2013-evolution-3581bfb3efdbdd9747749db0ddfa55a728f96719.tar.gz
gsoc2013-evolution-3581bfb3efdbdd9747749db0ddfa55a728f96719.tar.zst
gsoc2013-evolution-3581bfb3efdbdd9747749db0ddfa55a728f96719.zip
go slow and clear the map if the last uri and the current uri do not match
2001-12-19 JP Rosevear <jpr@ximian.com> * 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
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/e-itip-control.c35
1 files changed, 14 insertions, 21 deletions
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");