diff --git a/libgnucash/app-utils/gnc-sx-instance-model.c b/libgnucash/app-utils/gnc-sx-instance-model.c index 5628c8a9be..c0ba5c90ac 100644 --- a/libgnucash/app-utils/gnc-sx-instance-model.c +++ b/libgnucash/app-utils/gnc-sx-instance-model.c @@ -90,6 +90,14 @@ typedef struct gnc_numeric amount; } ScrubItem; +enum +{ + REMOVING, UPDATED, ADDED, + LAST_SIGNAL +}; + +static guint signals[LAST_SIGNAL] = { 0 }; + static void scrub_sx_split_numeric (Split* split, gboolean is_credit, GList **changes) { @@ -670,7 +678,7 @@ gnc_sx_instance_model_class_init (GncSxInstanceModelClass *klass) object_class->dispose = gnc_sx_instance_model_dispose; object_class->finalize = gnc_sx_instance_model_finalize; - klass->removing_signal_id = + signals[REMOVING] = g_signal_new("removing", GNC_TYPE_SX_INSTANCE_MODEL, G_SIGNAL_RUN_FIRST, @@ -682,7 +690,7 @@ gnc_sx_instance_model_class_init (GncSxInstanceModelClass *klass) 1, G_TYPE_POINTER); - klass->updated_signal_id = + signals[UPDATED] = g_signal_new("updated", GNC_TYPE_SX_INSTANCE_MODEL, G_SIGNAL_RUN_FIRST, @@ -694,7 +702,7 @@ gnc_sx_instance_model_class_init (GncSxInstanceModelClass *klass) 1, G_TYPE_POINTER); - klass->added_signal_id = + signals[ADDED] = g_signal_new("added", GNC_TYPE_SX_INSTANCE_MODEL, G_SIGNAL_RUN_FIRST, diff --git a/libgnucash/app-utils/gnc-sx-instance-model.h b/libgnucash/app-utils/gnc-sx-instance-model.h index c51739cc8b..fc1b5fca3f 100644 --- a/libgnucash/app-utils/gnc-sx-instance-model.h +++ b/libgnucash/app-utils/gnc-sx-instance-model.h @@ -35,11 +35,7 @@ G_BEGIN_DECLS #define GNC_TYPE_SX_INSTANCE_MODEL (gnc_sx_instance_model_get_type ()) -#define GNC_SX_INSTANCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_SX_INSTANCE_MODEL, GncSxInstanceModel)) -#define GNC_SX_INSTANCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_SX_INSTANCE_MODEL, GncSxInstanceModelClass)) -#define GNC_IS_SX_INSTANCE_MODEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_SX_INSTANCE_MODEL)) -#define GNC_IS_SX_INSTANCE_MODEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_SX_INSTANCE_MODEL)) -#define GNC_SX_INSTANCE_MODEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_SX_INSTANCE_MODEL, GncSxInstanceModelClass)) +G_DECLARE_FINAL_TYPE (GncSxInstanceModel, gnc_sx_instance_model, GNC, SX_INSTANCE_MODEL, GObject) typedef struct _GncSxInstanceModel { @@ -59,15 +55,6 @@ typedef struct _GncSxInstanceModel GList *sx_instance_list; /* */ } GncSxInstanceModel; -typedef struct _GncSxInstanceModelClass -{ - GObjectClass parent; - - guint removing_signal_id; - guint updated_signal_id; - guint added_signal_id; -} GncSxInstanceModelClass; - typedef struct _GncSxInstances { SchedXaction *sx; @@ -113,8 +100,6 @@ typedef struct _GncSxVariableNeeded GncSxVariable *variable; } GncSxVariableNeeded; -GType gnc_sx_instance_model_get_type(void); - /** Shorthand for get_instances(now, FALSE); */ GncSxInstanceModel* gnc_sx_get_current_instances(void);