From f3c94fc0f415a4025add6debe451ca3e9e449d83 Mon Sep 17 00:00:00 2001 From: Federico Mena Quintero Date: Wed, 12 Jan 2000 04:13:36 +0000 Subject: Removed the CORBA listener methods, adjusted for the new IDL. 2000-01-11 Federico Mena Quintero * cal.c: Removed the CORBA listener methods, adjusted for the new IDL. * cal-listener.c (cal_listener_init): Create the private structure. In it we hold a reference to the calendar the listener is watching. (cal_listener_destroy): Destroy the private structure and unref the calendar. (Listener_cal_loaded): Stuff the calendar into our private data. (Listener_obj_added): Adjusted for new IDL. (Listener_obj_removed): Likewise. svn path=/trunk/; revision=1560 --- calendar/pcs/cal.c | 35 ++++++----------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) (limited to 'calendar/pcs') diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c index 44b9361398..3394ead5d8 100644 --- a/calendar/pcs/cal.c +++ b/calendar/pcs/cal.c @@ -130,8 +130,10 @@ cal_destroy (GtkObject *object) CORBA_exception_init (&ev); - for (l = priv->listeners; l; l = l->next) + for (l = priv->listeners; l; l = l->next) { + GNOME_Unknown_unref (l->data, &ev); CORBA_Object_release (l->data, &ev); + } g_list_free (priv->listeners); @@ -160,30 +162,6 @@ Cal_get_uri (PortableServer_Servant servant, return CORBA_string_dup (priv->uri); } -/* Cal::add_listener method */ -static void -Cal_add_listener (PortableServer_Servant servant, - GNOME_Calendar_Listener listener, - CORBA_Environment *ev) -{ - Cal *cal; - - cal = CAL (gnome_object_from_servant (servant)); - cal_add_listener (cal, listener); -} - -/* Cal::remove_listener method */ -static void -Cal_remove_listener (PortableServer_Servant servant, - GNOME_Calendar_Listener listener, - CORBA_Environment *ev) -{ - Cal *cal; - - cal = CAL (gnome_object_from_servant (servant)); - cal_remove_listener (cal, listener); -} - /** * cal_get_epv: * @void: @@ -199,8 +177,6 @@ cal_get_epv (void) epv = g_new0 (POA_GNOME_Calendar_Cal__epv, 1); epv->get_uri = Cal_get_uri; - epv->add_listener = Cal_add_listener; - epv->remove_listener = Cal_remove_listener; return epv; } @@ -244,10 +220,10 @@ cal_construct (Cal *cal, GNOME_Calendar_Cal corba_cal) /** * cal_corba_object_create: * @object: #GnomeObject that will wrap the CORBA object. - * + * * Creates and activates the CORBA object that is wrapped by the specified * calendar @object. - * + * * Return value: An activated object reference or #CORBA_OBJECT_NIL in case of * failure. **/ @@ -334,6 +310,7 @@ cal_remove_listener (Cal *cal, GNOME_Calendar_Listener listener) for (l = priv->listeners; l; l = l->next) if (CORBA_Object_is_equivalent (listener, l->data)) { GNOME_Unknown_unref (listener, &ev); + CORBA_Object_release (listener, &ev); priv->listeners = g_list_remove_link (priv->listeners, l); g_list_free_1 (l); break; -- cgit v1.2.3