[krb5-auth-dialog: 4/14] applet: Switch to G_DEFINE_TYPE_WITH_PRIVATE




commit 9494cc8d3724d2503589c5adbd6abee138ed098f
Author: Guido Günther <agx sigxcpu org>
Date:   Mon Jan 4 18:19:48 2021 +0100

    applet: Switch to G_DEFINE_TYPE_WITH_PRIVATE
    
    This avoids deprecated code

 src/ka-applet.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
---
diff --git a/src/ka-applet.c b/src/ka-applet.c
index 50e6b70..75c6303 100644
--- a/src/ka-applet.c
+++ b/src/ka-applet.c
@@ -82,8 +82,6 @@ struct _KaAppletClass {
     guint signals[KA_SIGNAL_COUNT];
 };
 
-G_DEFINE_TYPE (KaApplet, ka_applet, GTK_TYPE_APPLICATION);
-
 struct _KaAppletPrivate {
     GtkStatusIcon *tray_icon;   /* the tray icon */
     GtkWidget *context_menu;    /* the tray icon's context menu */
@@ -117,6 +115,7 @@ struct _KaAppletPrivate {
     GSettings *settings;         /* GSettings client */
 };
 
+G_DEFINE_TYPE_WITH_PRIVATE (KaApplet, ka_applet, GTK_TYPE_APPLICATION);
 
 static void ka_close_notification (KaApplet *self);
 static gboolean is_initialized;
@@ -532,9 +531,7 @@ ka_applet_finalize (GObject *object)
 static void
 ka_applet_init (KaApplet *applet)
 {
-    applet->priv = G_TYPE_INSTANCE_GET_PRIVATE (applet,
-                                                KA_TYPE_APPLET,
-                                                KaAppletPrivate);
+    applet->priv = ka_applet_get_instance_private (applet);
 }
 
 static void
@@ -546,7 +543,6 @@ ka_applet_class_init (KaAppletClass *klass)
 
     object_class->dispose = ka_applet_dispose;
     object_class->finalize = ka_applet_finalize;
-    g_type_class_add_private (klass, sizeof (KaAppletPrivate));
 
     G_APPLICATION_CLASS (klass)->local_command_line =   \
         ka_applet_local_command_line;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]