diff options
author | Rodrigo Moya <rodrigo@ximian.com> | 2002-11-07 21:07:37 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2002-11-07 21:07:37 +0800 |
commit | e25263409df8e72ba17f300c8e6f2f4b533c7a1a (patch) | |
tree | 4e90c995a171c7933f878075116fce65a6ae1cbf /calendar/pcs/cal.c | |
parent | dd5ab1f16800794a475a8c0d8b7cf74641bc9a7f (diff) | |
download | gsoc2013-evolution-e25263409df8e72ba17f300c8e6f2f4b533c7a1a.tar.gz gsoc2013-evolution-e25263409df8e72ba17f300c8e6f2f4b533c7a1a.tar.zst gsoc2013-evolution-e25263409df8e72ba17f300c8e6f2f4b533c7a1a.zip |
converted to BonoboObject. (impl_Cal_get_query): bonobo_object_unref the
2002-11-07 Rodrigo Moya <rodrigo@ximian.com>
* pcs/cal.[ch]: converted to BonoboObject.
(impl_Cal_get_query): bonobo_object_unref the query returned by
cal_backend_get_query if we can't duplicate it.
* pcs/query.[ch]:
* pcs/cal-factory.[ch]: converted to BonoboObject.
* pcs/query-backend.[ch]:
* pcs/cal-backend-file.[ch]:
* pcs/cal-backend.[ch]: GObjectify.
svn path=/trunk/; revision=18630
Diffstat (limited to 'calendar/pcs/cal.c')
-rw-r--r-- | calendar/pcs/cal.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c index 861cc47c89..20ec86eb28 100644 --- a/calendar/pcs/cal.c +++ b/calendar/pcs/cal.c @@ -28,9 +28,9 @@ #include "query.h" #include "Evolution-Wombat.h" -#define PARENT_TYPE BONOBO_X_OBJECT_TYPE +#define PARENT_TYPE BONOBO_TYPE_OBJECT -static BonoboXObjectClass *parent_class; +static BonoboObjectClass *parent_class; /* Private part of the Cal structure */ struct _CalPrivate { @@ -553,6 +553,7 @@ impl_Cal_get_query (PortableServer_Servant servant, CORBA_exception_init (&ev2); query_copy = CORBA_Object_duplicate (BONOBO_OBJREF (query), &ev2); if (BONOBO_EX (&ev2)) { + bonobo_object_unref (query); CORBA_exception_free (&ev2); g_message ("Cal_get_query(): Could not duplicate the query reference"); bonobo_exception_set (ev, ex_GNOME_Evolution_Calendar_Cal_CouldNotCreate); @@ -687,7 +688,7 @@ cal_new (CalBackend *backend, GNOME_Evolution_Calendar_Listener listener) g_return_val_if_fail (backend != NULL, NULL); g_return_val_if_fail (IS_CAL_BACKEND (backend), NULL); - cal = CAL (gtk_type_new (CAL_TYPE)); + cal = CAL (g_object_new (CAL_TYPE, NULL)); retval = cal_construct (cal, backend, listener); if (!retval) { @@ -701,7 +702,7 @@ cal_new (CalBackend *backend, GNOME_Evolution_Calendar_Listener listener) /* Destroy handler for the calendar */ static void -cal_destroy (GtkObject *object) +cal_finalize (GObject *object) { Cal *cal; CalPrivate *priv; @@ -725,8 +726,8 @@ cal_destroy (GtkObject *object) g_free (priv); - if (GTK_OBJECT_CLASS (parent_class)->destroy) - (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); + if (G_OBJECT_CLASS (parent_class)->finalize) + (* G_OBJECT_CLASS (parent_class)->finalize) (object); } @@ -735,13 +736,13 @@ cal_destroy (GtkObject *object) static void cal_class_init (CalClass *klass) { - GtkObjectClass *object_class = (GtkObjectClass *) klass; + GObjectClass *object_class = (GObjectClass *) klass; POA_GNOME_Evolution_Calendar_Cal__epv *epv = &klass->epv; - parent_class = gtk_type_class (PARENT_TYPE); + parent_class = g_type_class_peek_parent (klass); /* Class method overrides */ - object_class->destroy = cal_destroy; + object_class->finalize = cal_finalize; /* Epv methods */ epv->_get_uri = impl_Cal_get_uri; @@ -767,7 +768,7 @@ cal_class_init (CalClass *klass) /* Object initialization function for the calendar */ static void -cal_init (Cal *cal) +cal_init (Cal *cal, CalClass *klass) { CalPrivate *priv; @@ -777,7 +778,7 @@ cal_init (Cal *cal) priv->listener = CORBA_OBJECT_NIL; } -BONOBO_X_TYPE_FUNC_FULL (Cal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, cal); +BONOBO_TYPE_FUNC_FULL (Cal, GNOME_Evolution_Calendar_Cal, PARENT_TYPE, cal); /** * cal_notify_mode: |