mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
convert GncJob to gobject initialization
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gobject-engine-dev-warlord@15822 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
7f007696f9
commit
e38adf311d
@ -46,6 +46,11 @@ struct _gncJob
|
|||||||
gboolean active;
|
gboolean active;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct _gncJobClass
|
||||||
|
{
|
||||||
|
QofInstanceClass parent_class;
|
||||||
|
};
|
||||||
|
|
||||||
static QofLogModule log_module = GNC_MOD_BUSINESS;
|
static QofLogModule log_module = GNC_MOD_BUSINESS;
|
||||||
|
|
||||||
#define _GNC_MOD_NAME GNC_ID_JOB
|
#define _GNC_MOD_NAME GNC_ID_JOB
|
||||||
@ -61,16 +66,28 @@ void mark_job (GncJob *job)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ================================================================== */
|
/* ================================================================== */
|
||||||
/* Create/Destroy Functions */
|
/* GObject Initialization */
|
||||||
|
QOF_GOBJECT_IMPL(gnc_job, GncJob, QOF_TYPE_INSTANCE);
|
||||||
|
|
||||||
|
static void
|
||||||
|
gnc_job_init(GncJob* job)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gnc_job_finalize_real(GObject* jobp)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Create/Destroy Functions */
|
||||||
GncJob *gncJobCreate (QofBook *book)
|
GncJob *gncJobCreate (QofBook *book)
|
||||||
{
|
{
|
||||||
GncJob *job;
|
GncJob *job;
|
||||||
|
|
||||||
if (!book) return NULL;
|
if (!book) return NULL;
|
||||||
|
|
||||||
job = g_new0 (GncJob, 1);
|
job = g_object_new (GNC_TYPE_JOB, NULL);
|
||||||
qof_instance_init (&job->inst, _GNC_MOD_NAME, book);
|
qof_instance_init_data (&job->inst, _GNC_MOD_NAME, book);
|
||||||
|
|
||||||
job->id = CACHE_INSERT ("");
|
job->id = CACHE_INSERT ("");
|
||||||
job->name = CACHE_INSERT ("");
|
job->name = CACHE_INSERT ("");
|
||||||
@ -90,8 +107,8 @@ gncCloneJob (GncJob *from, QofBook *book)
|
|||||||
|
|
||||||
if (!book) return NULL;
|
if (!book) return NULL;
|
||||||
|
|
||||||
job = g_new0 (GncJob, 1);
|
job = g_object_new (GNC_TYPE_JOB, NULL);
|
||||||
qof_instance_init (&job->inst, _GNC_MOD_NAME, book);
|
qof_instance_init_data (&job->inst, _GNC_MOD_NAME, book);
|
||||||
qof_instance_gemini (&job->inst, &from->inst);
|
qof_instance_gemini (&job->inst, &from->inst);
|
||||||
|
|
||||||
job->id = CACHE_INSERT (from->id);
|
job->id = CACHE_INSERT (from->id);
|
||||||
@ -134,8 +151,8 @@ static void gncJobFree (GncJob *job)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
qof_instance_release (&job->inst);
|
/* qof_instance_release (&job->inst); */
|
||||||
g_free (job);
|
g_object_unref (job);
|
||||||
}
|
}
|
||||||
|
|
||||||
GncJob *
|
GncJob *
|
||||||
|
@ -32,13 +32,26 @@
|
|||||||
#define GNC_JOB_H_
|
#define GNC_JOB_H_
|
||||||
|
|
||||||
typedef struct _gncJob GncJob;
|
typedef struct _gncJob GncJob;
|
||||||
|
typedef struct _gncJobClass GncJobClass;
|
||||||
|
|
||||||
#include "gncAddress.h"
|
#include "gncAddress.h"
|
||||||
#include "gncOwner.h"
|
#include "gncOwner.h"
|
||||||
|
|
||||||
#define GNC_ID_JOB "gncJob"
|
#define GNC_ID_JOB "gncJob"
|
||||||
#define GNC_IS_JOB(obj) (QOF_CHECK_TYPE((obj), GNC_ID_JOB))
|
|
||||||
#define GNC_JOB(obj) (QOF_CHECK_CAST((obj), GNC_ID_JOB, GncJob))
|
/* --- type macros --- */
|
||||||
|
#define GNC_TYPE_JOB (gnc_job_get_type ())
|
||||||
|
#define GNC_JOB(o) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_JOB, GncJob))
|
||||||
|
#define GNC_JOB_CLASS(k) \
|
||||||
|
(G_TYPE_CHECK_CLASS_CAST((k), GNC_TYPE_JOB, GncJobClass))
|
||||||
|
#define GNC_IS_JOB(o) \
|
||||||
|
(G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_JOB))
|
||||||
|
#define GNC_IS_JOB_CLASS(k) \
|
||||||
|
(G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_JOB))
|
||||||
|
#define GNC_JOB_GET_CLASS(o) \
|
||||||
|
(G_TYPE_INSTANCE_GET_CLASS ((o), GNC_TYPE_JOB, GncJobClass))
|
||||||
|
GType gnc_job_get_type(void);
|
||||||
|
|
||||||
/* Create/Destroy Functions */
|
/* Create/Destroy Functions */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user