mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
use G_DEFINE_TYPE_WITH_PRIVATE to replace g_type_class_add_private
gnc_tree_view_account_get_type is being replaced by that provided by G_DEFINE_TYPE_WITH_CODE and G_ADD_PRIVATE. Replace g_type_add_interface_static by G_IMPLEMENT_INTERFACE.
This commit is contained in:
parent
ddda853074
commit
8a4ef02c38
@ -144,44 +144,10 @@ gnc_tree_model_account_update_color (gpointer gsettings, gchar *key, gpointer us
|
|||||||
/** A pointer to the parent class of an account tree model. */
|
/** A pointer to the parent class of an account tree model. */
|
||||||
static GObjectClass *parent_class = NULL;
|
static GObjectClass *parent_class = NULL;
|
||||||
|
|
||||||
GType
|
G_DEFINE_TYPE_WITH_CODE (GncTreeModelAccount, gnc_tree_model_account, GNC_TYPE_TREE_MODEL,
|
||||||
gnc_tree_model_account_get_type (void)
|
G_ADD_PRIVATE (GncTreeModelAccount)
|
||||||
{
|
G_IMPLEMENT_INTERFACE (GTK_TYPE_TREE_MODEL,
|
||||||
static GType gnc_tree_model_account_type = 0;
|
gnc_tree_model_account_tree_model_init))
|
||||||
|
|
||||||
if (gnc_tree_model_account_type == 0)
|
|
||||||
{
|
|
||||||
static const GTypeInfo our_info =
|
|
||||||
{
|
|
||||||
sizeof (GncTreeModelAccountClass), /* class_size */
|
|
||||||
NULL, /* base_init */
|
|
||||||
NULL, /* base_finalize */
|
|
||||||
(GClassInitFunc) gnc_tree_model_account_class_init,
|
|
||||||
NULL, /* class_finalize */
|
|
||||||
NULL, /* class_data */
|
|
||||||
sizeof (GncTreeModelAccount), /* */
|
|
||||||
0, /* n_preallocs */
|
|
||||||
(GInstanceInitFunc) gnc_tree_model_account_init
|
|
||||||
};
|
|
||||||
|
|
||||||
static const GInterfaceInfo tree_model_info =
|
|
||||||
{
|
|
||||||
(GInterfaceInitFunc) gnc_tree_model_account_tree_model_init,
|
|
||||||
NULL,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
|
|
||||||
gnc_tree_model_account_type = g_type_register_static (GNC_TYPE_TREE_MODEL,
|
|
||||||
GNC_TREE_MODEL_ACCOUNT_NAME,
|
|
||||||
&our_info, 0);
|
|
||||||
|
|
||||||
g_type_add_interface_static (gnc_tree_model_account_type,
|
|
||||||
GTK_TYPE_TREE_MODEL,
|
|
||||||
&tree_model_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
return gnc_tree_model_account_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_tree_model_account_class_init (GncTreeModelAccountClass *klass)
|
gnc_tree_model_account_class_init (GncTreeModelAccountClass *klass)
|
||||||
@ -195,8 +161,6 @@ gnc_tree_model_account_class_init (GncTreeModelAccountClass *klass)
|
|||||||
/* GObject signals */
|
/* GObject signals */
|
||||||
o_class->finalize = gnc_tree_model_account_finalize;
|
o_class->finalize = gnc_tree_model_account_finalize;
|
||||||
o_class->dispose = gnc_tree_model_account_dispose;
|
o_class->dispose = gnc_tree_model_account_dispose;
|
||||||
|
|
||||||
g_type_class_add_private(klass, sizeof(GncTreeModelAccountPrivate));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user