diff options
author | Federico Mena Quintero <federico@helixcode.com> | 2000-02-12 10:03:58 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 2000-02-12 10:03:58 +0800 |
commit | d2fe58c56857e9e4b2e37f87174da6956b0d985c (patch) | |
tree | e71df413e8a7862616755f64700b1dbbc513f9be /calendar/cal-listener.c | |
parent | 123f506198c535dcb073c1998fed37c25ad131f9 (diff) | |
download | gsoc2013-evolution-d2fe58c56857e9e4b2e37f87174da6956b0d985c.tar gsoc2013-evolution-d2fe58c56857e9e4b2e37f87174da6956b0d985c.tar.gz gsoc2013-evolution-d2fe58c56857e9e4b2e37f87174da6956b0d985c.tar.bz2 gsoc2013-evolution-d2fe58c56857e9e4b2e37f87174da6956b0d985c.tar.lz gsoc2013-evolution-d2fe58c56857e9e4b2e37f87174da6956b0d985c.tar.xz gsoc2013-evolution-d2fe58c56857e9e4b2e37f87174da6956b0d985c.tar.zst gsoc2013-evolution-d2fe58c56857e9e4b2e37f87174da6956b0d985c.zip |
Implemented.
2000-02-11 Federico Mena Quintero <federico@helixcode.com>
* cal-client.c (cal_client_update_object): Implemented.
* cal.c (cal_notify_update): New function to notify the listener
about an updated object.
(Cal_update_object): Implemented.
(Cal_get_uids): set_release() the sequence to TRUE.
(Cal_get_events_in_range): Likewise.
* cal-backend.c (remove_object): New function to remove objects
from a calendar backend.
(cal_backend_update_object): New public function to update an
object and notify clients about it.
* evolution-calendar.idl (Cal): Added update_object() and
delete_object() methods.
(Listener): Removed the obj_changed method and renamed obj_added
to obj_updated. We now only have updated and removed notifiers.
* cal-listener.[ch]: Removed the "changed" notification code.
Changed the "added" notification code to the "updated"
notification.
* cal-client.c: Likewise.
* tlacuache.c (create_cal_factory): Connect to "destroy" on the
factory and exit the main loop when the factory is destroyed.
* cal-factory.c (backend_destroy_cb): New callback used when a
backend is destroyed. Removes the backend from the factory's hash
table and unrefs the factory if all backends go away.
(add_calendar_client): Free the environment.
* cal.c (cal_new): Use bonobo_object_unref() if we fail to
initialize.
* cal-listener.c (cal_listener_new): Likewise.
* layout.c (layout_events): Plug li.partition memory leak.
svn path=/trunk/; revision=1742
Diffstat (limited to 'calendar/cal-listener.c')
-rw-r--r-- | calendar/cal-listener.c | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/calendar/cal-listener.c b/calendar/cal-listener.c index 32024d04f5..2c875c4c38 100644 --- a/calendar/cal-listener.c +++ b/calendar/cal-listener.c @@ -36,9 +36,8 @@ typedef struct { /* Signal IDs */ enum { CAL_LOADED, - OBJ_ADDED, + OBJ_UPDATED, OBJ_REMOVED, - OBJ_CHANGED, LAST_SIGNAL }; @@ -115,11 +114,11 @@ cal_listener_class_init (CalListenerClass *class) GTK_TYPE_NONE, 2, GTK_TYPE_ENUM, GTK_TYPE_POINTER); - cal_listener_signals[OBJ_ADDED] = - gtk_signal_new ("obj_added", + cal_listener_signals[OBJ_UPDATED] = + gtk_signal_new ("obj_updated", GTK_RUN_FIRST, object_class->type, - GTK_SIGNAL_OFFSET (CalListenerClass, obj_added), + GTK_SIGNAL_OFFSET (CalListenerClass, obj_updated), gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); @@ -131,14 +130,6 @@ cal_listener_class_init (CalListenerClass *class) gtk_marshal_NONE__POINTER, GTK_TYPE_NONE, 1, GTK_TYPE_POINTER); - cal_listener_signals[OBJ_CHANGED] = - gtk_signal_new ("obj_changed", - GTK_RUN_FIRST, - object_class->type, - GTK_SIGNAL_OFFSET (CalListenerClass, obj_changed), - gtk_marshal_NONE__POINTER, - GTK_TYPE_NONE, 1, - GTK_TYPE_POINTER); gtk_object_class_add_signals (object_class, cal_listener_signals, LAST_SIGNAL); @@ -272,16 +263,16 @@ Listener_cal_loaded (PortableServer_Servant servant, load_status, cal); } -/* Listener::obj_added method */ +/* Listener::obj_updated method */ static void -Listener_obj_added (PortableServer_Servant servant, - Evolution_Calendar_CalObjUID uid, - CORBA_Environment *ev) +Listener_obj_updated (PortableServer_Servant servant, + Evolution_Calendar_CalObjUID uid, + CORBA_Environment *ev) { CalListener *listener; listener = CAL_LISTENER (bonobo_object_from_servant (servant)); - gtk_signal_emit (GTK_OBJECT (listener), cal_listener_signals[OBJ_ADDED], + gtk_signal_emit (GTK_OBJECT (listener), cal_listener_signals[OBJ_UPDATED], uid); } @@ -298,19 +289,6 @@ Listener_obj_removed (PortableServer_Servant servant, uid); } -/* Listener::obj_changed method */ -static void -Listener_obj_changed (PortableServer_Servant servant, - Evolution_Calendar_CalObjUID uid, - CORBA_Environment *ev) -{ - CalListener *listener; - - listener = CAL_LISTENER (bonobo_object_from_servant (servant)); - gtk_signal_emit (GTK_OBJECT (listener), cal_listener_signals[OBJ_CHANGED], - uid); -} - /** * cal_listener_get_epv: * @void: @@ -326,10 +304,8 @@ cal_listener_get_epv (void) epv = g_new0 (POA_Evolution_Calendar_Listener__epv, 1); epv->cal_loaded = Listener_cal_loaded; - epv->obj_added = Listener_obj_added; + epv->obj_updated = Listener_obj_updated; epv->obj_removed = Listener_obj_removed; - epv->obj_changed = Listener_obj_changed; - return epv; } @@ -415,7 +391,7 @@ cal_listener_new (void) if (ev._major != CORBA_NO_EXCEPTION || result) { g_message ("cal_listener_new(): could not create the CORBA listener"); - gtk_object_unref (GTK_OBJECT (listener)); + bonobo_object_unref (BONOBO_OBJECT (listener)); CORBA_exception_free (&ev); return NULL; } |