mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Convert SchedXaction to GObject initialization.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gobject-engine-dev-warlord@15805 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
1cbf8b848c
commit
f1e6425dce
@ -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 );
|
||||
}
|
||||
|
||||
/* ============================================================ */
|
||||
|
@ -36,6 +36,8 @@
|
||||
#ifndef XACC_SCHEDXACTION_H
|
||||
#define XACC_SCHEDXACTION_H
|
||||
|
||||
typedef struct _SchedXactionClass SchedXactionClass;
|
||||
|
||||
#include <time.h>
|
||||
#include <glib.h>
|
||||
#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 /* <temporalStateData*> */ *deferredList;
|
||||
};
|
||||
|
||||
struct _SchedXactionClass
|
||||
{
|
||||
QofInstanceClass parent_class;
|
||||
};
|
||||
|
||||
/** Just the variable temporal bits from the SX structure. */
|
||||
typedef struct _temporalStateData {
|
||||
GDate last_date;
|
||||
|
Loading…
Reference in New Issue
Block a user