diff options
author | Wu Xiaotian <[email protected]> | 2019-01-21 12:57:44 +0800 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-01-22 04:37:40 +0000 |
commit | a9211bd0f251b891ef506ed0af8b574ae8e3fee9 (patch) | |
tree | 6f687e2cec21810ce37512f1af47a4aae3a108f3 /libcaja-extension | |
parent | 10efec8be67f2254ecaf197801e67e59d6d2a467 (diff) | |
download | caja-a9211bd0f251b891ef506ed0af8b574ae8e3fee9.tar.bz2 caja-a9211bd0f251b891ef506ed0af8b574ae8e3fee9.tar.xz |
caja-menu: avoid deprecated 'g_type_class_add_private'
Diffstat (limited to 'libcaja-extension')
-rw-r--r-- | libcaja-extension/caja-menu.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libcaja-extension/caja-menu.c b/libcaja-extension/caja-menu.c index f7918184..5ed0fd21 100644 --- a/libcaja-extension/caja-menu.c +++ b/libcaja-extension/caja-menu.c @@ -38,13 +38,13 @@ * #CajaMenuItem objects, using caja_menu_item_set_submenu(). */ -#define CAJA_MENU_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CAJA_TYPE_MENU, CajaMenuPrivate)) -G_DEFINE_TYPE (CajaMenu, caja_menu, G_TYPE_OBJECT); struct _CajaMenuPrivate { GList *item_list; }; +G_DEFINE_TYPE_WITH_PRIVATE (CajaMenu, caja_menu, G_TYPE_OBJECT); + void caja_menu_append_item (CajaMenu *menu, CajaMenuItem *item) { @@ -104,7 +104,7 @@ caja_menu_finalize (GObject *object) static void caja_menu_init (CajaMenu *menu) { - menu->priv = CAJA_MENU_GET_PRIVATE (menu); + menu->priv = caja_menu_get_instance_private (menu); menu->priv->item_list = NULL; } @@ -114,8 +114,6 @@ caja_menu_class_init (CajaMenuClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (CajaMenuPrivate)); - object_class->finalize = caja_menu_finalize; } |