summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-08-22 00:20:13 +0200
committerlukefromdc <[email protected]>2019-09-02 23:58:10 +0000
commita426a8d8b346a9559793737e70704e36259aef57 (patch)
treebc24e23d2ea8c11fab776c40f1220ba2f56f1447
parent70fc5182630b02a1fb73623e5bc50c67ecbe1e4e (diff)
downloadmate-utils-a426a8d8b346a9559793737e70704e36259aef57.tar.bz2
mate-utils-a426a8d8b346a9559793737e70704e36259aef57.tar.xz
gdict-sidebar: avoid 'g_type_class_add_private'
-rw-r--r--mate-dictionary/src/gdict-sidebar.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/mate-dictionary/src/gdict-sidebar.c b/mate-dictionary/src/gdict-sidebar.c
index b903677c..1eacb15b 100644
--- a/mate-dictionary/src/gdict-sidebar.c
+++ b/mate-dictionary/src/gdict-sidebar.c
@@ -47,8 +47,6 @@ typedef struct
GtkWidget *menu_item;
} SidebarPage;
-#define GDICT_SIDEBAR_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GDICT_TYPE_SIDEBAR, GdictSidebarPrivate))
-
struct _GdictSidebarPrivate
{
GHashTable *pages_by_id;
@@ -73,7 +71,7 @@ enum
static guint sidebar_signals[LAST_SIGNAL] = { 0 };
static GQuark sidebar_page_id_quark = 0;
-G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_BOX);
+G_DEFINE_TYPE_WITH_PRIVATE (GdictSidebar, gdict_sidebar, GTK_TYPE_BOX);
SidebarPage *
sidebar_page_new (const gchar *id,
@@ -258,8 +256,6 @@ gdict_sidebar_class_init (GdictSidebarClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (gobject_class, sizeof (GdictSidebarPrivate));
-
sidebar_page_id_quark = g_quark_from_static_string ("gdict-sidebar-page-id");
gobject_class->finalize = gdict_sidebar_finalize;
@@ -294,7 +290,7 @@ gdict_sidebar_init (GdictSidebar *sidebar)
GtkWidget *arrow;
gtk_orientable_set_orientation (GTK_ORIENTABLE (sidebar), GTK_ORIENTATION_VERTICAL);
- sidebar->priv = priv = GDICT_SIDEBAR_GET_PRIVATE (sidebar);
+ sidebar->priv = priv = gdict_sidebar_get_instance_private (sidebar);
/* we store all the pages inside the list, but we keep
* a pointer inside the hash table for faster look up