aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal.c
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-02-17 17:21:20 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-02-17 17:21:20 +0800
commitcf16aa4fb112337616d20f4f2f9c2512cbe5e82f (patch)
treee8e3eb3c798e3a2492a9f8c1a045b85a04479d99 /calendar/cal.c
parent514b2de963c04ce463ff84a54933673be284ad45 (diff)
downloadgsoc2013-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.c')
-rw-r--r--calendar/cal.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/calendar/cal.c b/calendar/cal.c
index 158e4c493c..8263bfe491 100644
--- a/calendar/cal.c
+++ b/calendar/cal.c
@@ -325,6 +325,24 @@ Cal_update_object (PortableServer_Servant servant,
NULL);
}
+/* Cal::remove_object method */
+static void
+Cal_remove_object (PortableServer_Servant servant,
+ const Evolution_Calendar_CalObjUID uid,
+ CORBA_Environment *ev)
+{
+ Cal *cal;
+ CalPrivate *priv;
+
+ cal = CAL (bonobo_object_from_servant (servant));
+ priv = cal->priv;
+
+ if (!cal_backend_remove_object (priv->backend, uid))
+ CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
+ ex_Evolution_Calendar_Cal_NotFound,
+ NULL);
+}
+
/**
* cal_get_epv:
* @void:
@@ -344,6 +362,7 @@ cal_get_epv (void)
epv->get_uids = Cal_get_uids;
epv->get_events_in_range = Cal_get_events_in_range;
epv->update_object = Cal_update_object;
+ epv->remove_object = Cal_remove_object;
return epv;
}
@@ -507,3 +526,34 @@ cal_notify_update (Cal *cal, const char *uid)
CORBA_exception_free (&ev);
}
+
+/**
+ * cal_notify_remove:
+ * @cal: A calendar client interface.
+ * @uid: UID of object that was removed.
+ *
+ * Notifies a listener attached to a calendar client interface object about a
+ * calendar object that was removed.
+ **/
+void
+cal_notify_remove (Cal *cal, const char *uid)
+{
+ CalPrivate *priv;
+ CORBA_Environment ev;
+
+ g_return_if_fail (cal != NULL);
+ g_return_if_fail (IS_CAL (cal));
+ g_return_if_fail (uid != NULL);
+
+ priv = cal->priv;
+ g_return_if_fail (priv->listener != CORBA_OBJECT_NIL);
+
+ CORBA_exception_init (&ev);
+ Evolution_Calendar_Listener_obj_removed (priv->listener, uid, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION)
+ g_message ("cal_notify_remove(): could not notify the listener "
+ "about a removed object");
+
+ CORBA_exception_free (&ev);
+}