From cafa53eedd1f22b668f20b863116dc7b318a2647 Mon Sep 17 00:00:00 2001 From: Pablo Barciela Date: Wed, 30 Oct 2019 11:37:12 +0100 Subject: task-item: avoid 'g_type_class_add_private' --- mate-window-picker-applet/task-item.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/mate-window-picker-applet/task-item.c b/mate-window-picker-applet/task-item.c index a3a1089..34a4ef9 100644 --- a/mate-window-picker-applet/task-item.c +++ b/mate-window-picker-applet/task-item.c @@ -24,12 +24,6 @@ #include #include -G_DEFINE_TYPE (TaskItem, task_item, GTK_TYPE_EVENT_BOX); - -#define TASK_ITEM_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj),\ - TASK_TYPE_ITEM, \ - TaskItemPrivate)) - #define DEFAULT_TASK_ITEM_HEIGHT 24; #define DEFAULT_TASK_ITEM_WIDTH 28 @@ -50,6 +44,8 @@ enum { LAST_SIGNAL }; +G_DEFINE_TYPE_WITH_PRIVATE (TaskItem, task_item, GTK_TYPE_EVENT_BOX); + /* D&D stuff */ static const GtkTargetEntry drop_types[] = { @@ -706,7 +702,7 @@ static void task_item_finalize (GObject *object) { TaskItemPrivate *priv; - priv = TASK_ITEM_GET_PRIVATE (object); + priv = TASK_ITEM (object)->priv; /* remove timer */ if (priv->timer) @@ -734,8 +730,6 @@ task_item_class_init (TaskItemClass *klass) widget_class->get_preferred_width = task_item_get_preferred_width; widget_class->get_preferred_height = task_item_get_preferred_height; - g_type_class_add_private (obj_class, sizeof (TaskItemPrivate)); - task_item_signals [TASK_ITEM_CLOSED_SIGNAL] = g_signal_new ("task-item-closed", G_TYPE_FROM_CLASS (klass), @@ -749,7 +743,7 @@ static void task_item_init (TaskItem *item) { TaskItemPrivate *priv; - priv = item->priv = TASK_ITEM_GET_PRIVATE (item); + priv = item->priv = task_item_get_instance_private (item); priv->timer = 0; } -- cgit v1.2.1