aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-client
diff options
context:
space:
mode:
authorSeth Alves <alves@src.gnome.org>2000-06-29 21:23:44 +0800
committerSeth Alves <alves@src.gnome.org>2000-06-29 21:23:44 +0800
commit70c974e7d9d44db682cd9cc447485f292ad2aa54 (patch)
tree83d68fc016f555e36e8fa010d1f8b2367307fff3 /calendar/cal-client
parentfe1bb9d0b60ab6a1b8a8c525d28d0b09d2d74641 (diff)
downloadgsoc2013-evolution-70c974e7d9d44db682cd9cc447485f292ad2aa54.tar
gsoc2013-evolution-70c974e7d9d44db682cd9cc447485f292ad2aa54.tar.gz
gsoc2013-evolution-70c974e7d9d44db682cd9cc447485f292ad2aa54.tar.bz2
gsoc2013-evolution-70c974e7d9d44db682cd9cc447485f292ad2aa54.tar.lz
gsoc2013-evolution-70c974e7d9d44db682cd9cc447485f292ad2aa54.tar.xz
gsoc2013-evolution-70c974e7d9d44db682cd9cc447485f292ad2aa54.tar.zst
gsoc2013-evolution-70c974e7d9d44db682cd9cc447485f292ad2aa54.zip
server code to service these:
* pcs/cal.c (Cal_get_uid_by_pilot_id): (Cal_update_pilot_id): * pcs/cal-backend-imc.c (cal_backend_imc_update_pilot_id): (cal_backend_imc_get_uid_by_pilot_id): * pcs/cal-backend.c (cal_backend_get_uid_by_pilot_id): (cal_backend_update_pilot_id): server code to service these: * gui/calendar-pilot-sync.c: updated to make use of cal-client. also uses dirty bits on both sides to aid in syncing. * cal-client/cal-client.c (cal_client_get_uid_by_pilot_id): new function -- ask the cal server to return uid given an object's pilot id. (cal_client_update_pilot_id): new function -- inform the cal server of an objects pilot id and pilot dirty-flag. svn path=/trunk/; revision=3789
Diffstat (limited to 'calendar/cal-client')
-rw-r--r--calendar/cal-client/cal-client.c73
-rw-r--r--calendar/cal-client/cal-client.h8
2 files changed, 80 insertions, 1 deletions
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c
index f1e60be3f3..3023a37dc1 100644
--- a/calendar/cal-client/cal-client.c
+++ b/calendar/cal-client/cal-client.c
@@ -687,6 +687,77 @@ cal_client_get_object (CalClient *client, const char *uid, iCalObject **ico)
#endif
}
+
+
+CalClientGetStatus cal_client_get_uid_by_pilot_id (CalClient *client,
+ unsigned long pilot_id,
+ char **uid)
+{
+ CalClientPrivate *priv;
+ CORBA_Environment ev;
+ CalClientGetStatus retval;
+ char *uid_str;
+
+ g_return_val_if_fail (client != NULL, CAL_CLIENT_GET_NOT_FOUND);
+ g_return_val_if_fail (IS_CAL_CLIENT (client),
+ CAL_CLIENT_GET_NOT_FOUND);
+
+ priv = client->priv;
+ g_return_val_if_fail (priv->load_state == LOAD_STATE_LOADED,
+ CAL_CLIENT_GET_NOT_FOUND);
+
+ retval = CAL_CLIENT_GET_NOT_FOUND;
+ *uid = NULL;
+
+ CORBA_exception_init (&ev);
+ uid_str = Evolution_Calendar_Cal_get_uid_by_pilot_id (priv->cal, pilot_id, &ev);
+
+ if (ev._major == CORBA_USER_EXCEPTION &&
+ strcmp (CORBA_exception_id (&ev),
+ ex_Evolution_Calendar_Cal_NotFound) == 0)
+ goto out;
+ else if (ev._major != CORBA_NO_EXCEPTION) {
+ //g_message ("cal_client_get_object(): could not get the object");
+ goto out;
+ }
+
+ if (uid_str) {
+ retval = CAL_CLIENT_GET_SUCCESS;
+ (*uid) = g_strdup (uid_str);
+ CORBA_free (uid_str);
+ }
+
+ out:
+
+ CORBA_exception_free (&ev);
+ return retval;
+}
+
+
+
+void cal_client_update_pilot_id (CalClient *client, char *uid,
+ unsigned long pilot_id,
+ unsigned long pilot_status)
+{
+ CalClientPrivate *priv;
+ CORBA_Environment ev;
+
+ g_return_if_fail (client != NULL);
+ g_return_if_fail (IS_CAL_CLIENT (client));
+
+ priv = client->priv;
+ g_return_if_fail (priv->load_state == LOAD_STATE_LOADED);
+
+ CORBA_exception_init (&ev);
+ Evolution_Calendar_Cal_update_pilot_id (priv->cal, uid,
+ pilot_id, pilot_status,
+ &ev);
+
+ CORBA_exception_free (&ev);
+}
+
+
+
/**
* cal_client_get_uids:
* @client: A calendar client.
@@ -1052,7 +1123,7 @@ cal_client_remove_object (CalClient *client, const char *uid)
strcmp (CORBA_exception_id (&ev), ex_Evolution_Calendar_Cal_NotFound) == 0)
goto out;
else if (ev._major != CORBA_NO_EXCEPTION) {
- g_message ("cal_client_remove_object(): could not remove the object");
+ /*g_message ("cal_client_remove_object(): could not remove the object");*/
goto out;
}
diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h
index 7c67cfba2e..5dc30ddec2 100644
--- a/calendar/cal-client/cal-client.h
+++ b/calendar/cal-client/cal-client.h
@@ -87,6 +87,14 @@ CalClientGetStatus cal_client_get_object (CalClient *client,
const char *uid,
iCalObject **ico);
+CalClientGetStatus cal_client_get_uid_by_pilot_id (CalClient *client,
+ unsigned long pilot_id,
+ char **uid);
+
+void cal_client_update_pilot_id (CalClient *client, char *uid,
+ unsigned long pilot_id,
+ unsigned long pilot_status);
+
GList *cal_client_get_uids (CalClient *client, CalObjType type);
GList *cal_client_get_events_in_range (CalClient *client, time_t start, time_t end);