aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/conduits
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/conduits')
-rw-r--r--calendar/conduits/calendar/calendar-conduit.c38
-rw-r--r--calendar/conduits/calendar/calendar-conduit.h3
-rw-r--r--calendar/conduits/todo/todo-conduit.c38
-rw-r--r--calendar/conduits/todo/todo-conduit.h3
4 files changed, 34 insertions, 48 deletions
diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c
index 1ffe47b890..0ed563b574 100644
--- a/calendar/conduits/calendar/calendar-conduit.c
+++ b/calendar/conduits/calendar/calendar-conduit.c
@@ -162,29 +162,23 @@ e_calendar_context_destroy (ECalConduitContext *ctxt)
/* Calendar Server routines */
static void
-start_calendar_server_cb (GtkWidget *cal_client,
- CalClientLoadStatus status,
- ECalConduitContext *ctxt)
+start_calendar_server_cb (CalClient *cal_client,
+ CalClientOpenStatus status,
+ gpointer data)
{
- CalClient *client = CAL_CLIENT (cal_client);
+ ECalConduitContext *ctxt;
+
+ ctxt = data;
- LOG (" entering start_calendar_server_load_cb, tried=%d\n",
- ctxt->calendar_load_tried);
+ LOG (" entering start_calendar_server_cb\n");
- if (status == CAL_CLIENT_LOAD_SUCCESS) {
- ctxt->calendar_load_success = TRUE;
+ if (status == CAL_CLIENT_OPEN_SUCCESS) {
+ ctxt->calendar_open_success = TRUE;
LOG (" success\n");
- gtk_main_quit (); /* end the sub event loop */
- } else {
- if (ctxt->calendar_load_tried) {
- LOG (" load and create of calendar failed\n");
- gtk_main_quit (); /* end the sub event loop */
- return;
- }
+ } else
+ LOG (" open of calendar failed\n");
- cal_client_create_calendar (client, ctxt->calendar_file);
- ctxt->calendar_load_tried = TRUE;
- }
+ gtk_main_quit (); /* end the sub event loop */
}
static int
@@ -199,17 +193,17 @@ start_calendar_server (ECalConduitContext *ctxt)
ctxt->calendar_file = g_concat_dir_and_file (g_get_home_dir (),
"evolution/local/Calendar/calendar.ics");
- gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_loaded",
+ gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_opened",
start_calendar_server_cb, ctxt);
- LOG (" calling cal_client_load_calendar\n");
- cal_client_load_calendar (ctxt->client, ctxt->calendar_file);
+ LOG (" calling cal_client_open_calendar\n");
+ cal_client_open_calendar (ctxt->client, ctxt->calendar_file, FALSE);
/* run a sub event loop to turn cal-client's async load
notification into a synchronous call */
gtk_main ();
- if (ctxt->calendar_load_success)
+ if (ctxt->calendar_open_success)
return 0;
return -1;
diff --git a/calendar/conduits/calendar/calendar-conduit.h b/calendar/conduits/calendar/calendar-conduit.h
index 3b998716a2..03308e77d9 100644
--- a/calendar/conduits/calendar/calendar-conduit.h
+++ b/calendar/conduits/calendar/calendar-conduit.h
@@ -60,8 +60,7 @@ struct _ECalConduitContext {
CalClient *client;
char *calendar_file;
- gboolean calendar_load_tried;
- gboolean calendar_load_success;
+ gboolean calendar_open_success;
time_t since;
GList *uids;
diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c
index 07fe9f3122..fe50a7869b 100644
--- a/calendar/conduits/todo/todo-conduit.c
+++ b/calendar/conduits/todo/todo-conduit.c
@@ -166,29 +166,23 @@ e_todo_context_destroy (EToDoConduitContext *ctxt)
/* Calendar Server routines */
static void
-start_calendar_server_cb (GtkWidget *cal_client,
- CalClientLoadStatus status,
- EToDoConduitContext *ctxt)
+start_calendar_server_cb (CalClient *cal_client,
+ CalClientOpenStatus status,
+ gpointer data)
{
- CalClient *client = CAL_CLIENT (cal_client);
+ EToDoConduitContext *ctxt;
+
+ ctxt = data;
- LOG (" entering start_calendar_server_load_cb, tried=%d\n",
- ctxt->calendar_load_tried);
+ LOG (" entering start_calendar_server_cb\n");
- if (status == CAL_CLIENT_LOAD_SUCCESS) {
- ctxt->calendar_load_success = TRUE;
+ if (status == CAL_CLIENT_OPEN_SUCCESS) {
+ ctxt->calendar_open_success = TRUE;
LOG (" success\n");
- gtk_main_quit (); /* end the sub event loop */
- } else {
- if (ctxt->calendar_load_tried) {
- LOG (" load and create of calendar failed\n");
- gtk_main_quit (); /* end the sub event loop */
- return;
- }
+ } else
+ LOG (" open of calendar failed\n");
- cal_client_create_calendar (client, ctxt->calendar_file);
- ctxt->calendar_load_tried = TRUE;
- }
+ gtk_main_quit (); /* end the sub event loop */
}
static int
@@ -203,17 +197,17 @@ start_calendar_server (EToDoConduitContext *ctxt)
ctxt->calendar_file = g_concat_dir_and_file (g_get_home_dir (),
"evolution/local/Tasks/tasks.ics");
- gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_loaded",
+ gtk_signal_connect (GTK_OBJECT (ctxt->client), "cal_opened",
start_calendar_server_cb, ctxt);
- LOG (" calling cal_client_load_calendar\n");
- cal_client_load_calendar (ctxt->client, ctxt->calendar_file);
+ LOG (" calling cal_client_open_calendar\n");
+ cal_client_open_calendar (ctxt->client, ctxt->calendar_file, FALSE);
/* run a sub event loop to turn cal-client's async load
notification into a synchronous call */
gtk_main ();
- if (ctxt->calendar_load_success)
+ if (ctxt->calendar_open_success)
return 0;
return -1;
diff --git a/calendar/conduits/todo/todo-conduit.h b/calendar/conduits/todo/todo-conduit.h
index 80245b11b0..46f89fc1a0 100644
--- a/calendar/conduits/todo/todo-conduit.h
+++ b/calendar/conduits/todo/todo-conduit.h
@@ -60,8 +60,7 @@ struct _EToDoConduitContext {
CalClient *client;
char *calendar_file;
- gboolean calendar_load_tried;
- gboolean calendar_load_success;
+ gboolean calendar_open_success;
GList *uids;
GList *changed;