diff --git a/src/engine/SchedXaction.c b/src/engine/SchedXaction.c index 7aed1ca3fd..c02841f700 100644 --- a/src/engine/SchedXaction.c +++ b/src/engine/SchedXaction.c @@ -45,12 +45,25 @@ void sxprivtransactionListMapDelete( gpointer data, gpointer user_data ); +/* GObject initialization */ +QOF_GOBJECT_IMPL(gnc_schedxaction, SchedXaction, QOF_TYPE_INSTANCE); + +static void +gnc_schedxaction_init(SchedXaction* fs) +{ +} + +static void +gnc_schedxaction_finalize_real(GObject* fsp) +{ +} + static void xaccSchedXactionInit(SchedXaction *sx, QofBook *book) { Account *ra; - qof_instance_init (&sx->inst, GNC_ID_SCHEDXACTION, book); + qof_instance_init_data (&sx->inst, GNC_ID_SCHEDXACTION, book); sx->schedule = NULL; sx->freq = xaccFreqSpecMalloc(book); @@ -89,7 +102,7 @@ xaccSchedXactionMalloc(QofBook *book) g_return_val_if_fail (book, NULL); - sx = g_new0( SchedXaction, 1 ); + sx = g_object_new(GNC_TYPE_SCHEDXACTION, NULL); xaccSchedXactionInit( sx, book ); qof_event_gen( &sx->inst, QOF_EVENT_CREATE , NULL); @@ -187,8 +200,8 @@ xaccSchedXactionFree( SchedXaction *sx ) sx->deferredList = NULL; } - qof_instance_release (&sx->inst); - g_free( sx ); + /* qof_instance_release (&sx->inst); */ + g_object_unref( sx ); } /* ============================================================ */ diff --git a/src/engine/SchedXaction.h b/src/engine/SchedXaction.h index 248787cdf6..ed7a6849b5 100644 --- a/src/engine/SchedXaction.h +++ b/src/engine/SchedXaction.h @@ -36,6 +36,8 @@ #ifndef XACC_SCHEDXACTION_H #define XACC_SCHEDXACTION_H +typedef struct _SchedXactionClass SchedXactionClass; + #include #include #include "qof.h" @@ -43,8 +45,22 @@ #include "Recurrence.h" #include "gnc-engine.h" -#define GNC_IS_SX(obj) (QOF_CHECK_TYPE((obj), GNC_ID_SCHEDXACTION)) -#define GNC_SX(obj) (QOF_CHECK_CAST((obj), GNC_ID_SCHEDXACTION, SchedXaction)) +/* --- type macros --- */ +#define GNC_TYPE_SCHEDXACTION (gnc_schedxaction_get_type ()) +#define GNC_SCHEDXACTION(o) \ + (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_SCHEDXACTION, SchedXaction)) +#define GNC_SCHEDXACTION_CLASS(k) \ + (G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_SCHEDXACTION, SchedXactionClass)) +#define GNC_IS_SCHEDXACTION(o) \ + (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_SCHEDXACTION)) +#define GNC_IS_SCHEDXACTION_CLASS(k) \ + (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_SCHEDXACTION)) +#define GNC_SCHEDXACTION_GET_CLASS(o) \ + (G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_SCHEDXACTION, SchedXactionClass)) +GType gnc_schedxaction_get_type(void); + +#define GNC_IS_SX(obj) GNC_IS_SCHEDXACTION(obj) +#define GNC_SX(obj) GNC_SCHEDXACTION(obj) typedef struct _SchedXaction SchedXaction; @@ -104,6 +120,11 @@ struct _SchedXaction GList /* */ *deferredList; }; +struct _SchedXactionClass +{ + QofInstanceClass parent_class; +}; + /** Just the variable temporal bits from the SX structure. */ typedef struct _temporalStateData { GDate last_date;