diff options
author | Federico Mena Quintero <federico@helixcode.com> | 2000-02-17 17:21:20 +0800 |
---|---|---|
committer | Federico Mena Quintero <federico@src.gnome.org> | 2000-02-17 17:21:20 +0800 |
commit | cf16aa4fb112337616d20f4f2f9c2512cbe5e82f (patch) | |
tree | e8e3eb3c798e3a2492a9f8c1a045b85a04479d99 /calendar/cal-client | |
parent | 514b2de963c04ce463ff84a54933673be284ad45 (diff) | |
download | gsoc2013-evolution-cf16aa4fb112337616d20f4f2f9c2512cbe5e82f.tar.gz gsoc2013-evolution-cf16aa4fb112337616d20f4f2f9c2512cbe5e82f.tar.zst gsoc2013-evolution-cf16aa4fb112337616d20f4f2f9c2512cbe5e82f.zip |
Implemented.
2000-02-17 Federico Mena Quintero <federico@helixcode.com>
* cal-client.c (cal_client_remove_object): Implemented.
* cal.c (cal_notify_remove): Implemented.
(Cal_remove_object): Implemented.
(cal_get_epv): Fill in the remove_object field in the epv.
* cal-backend.c (cal_backend_remove_object): Implemented.
(notify_remove): New function to notify clients that an object was
removed.
svn path=/trunk/; revision=1821
Diffstat (limited to 'calendar/cal-client')
-rw-r--r-- | calendar/cal-client/cal-client.c | 35 | ||||
-rw-r--r-- | calendar/cal-client/cal-client.h | 2 |
2 files changed, 37 insertions, 0 deletions
diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c index 9b25740318..ebf2b5cb31 100644 --- a/calendar/cal-client/cal-client.c +++ b/calendar/cal-client/cal-client.c @@ -746,3 +746,38 @@ cal_client_update_object (CalClient *client, const char *uid, const char *calobj CORBA_exception_free (&ev); return retval; } + +gboolean +cal_client_remove_object (CalClient *client, const char *uid) +{ + CalClientPrivate *priv; + CORBA_Environment ev; + gboolean retval; + + g_return_val_if_fail (client != NULL, FALSE); + g_return_val_if_fail (IS_CAL_CLIENT (client), FALSE); + + priv = client->priv; + g_return_val_if_fail (priv->load_state == LOAD_STATE_LOADED, FALSE); + + g_return_val_if_fail (uid != NULL, FALSE); + + retval = FALSE; + + CORBA_exception_init (&ev); + Evolution_Calendar_Cal_remove_object (priv->cal, uid, &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_remove_object(): could not remove the object"); + goto out; + } + + retval = TRUE; + + out: + CORBA_exception_free (&ev); + return retval; +} diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h index 7baad2c733..7b5c66e510 100644 --- a/calendar/cal-client/cal-client.h +++ b/calendar/cal-client/cal-client.h @@ -81,6 +81,8 @@ GList *cal_client_get_events_in_range (CalClient *client, time_t start, time_t e gboolean cal_client_update_object (CalClient *client, const char *uid, const char *calobj); +gboolean cal_client_remove_object (CalClient *client, const char *uid); + END_GNOME_DECLS |