[dconf: 1/2] service: Port from g_type_class_add_private() to G_ADD_PRIVATE()



commit 038fec9f8ecc4059d3ac993e35b7e5b01ed27c1b
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Aug 1 10:23:13 2018 +0100

    service: Port from g_type_class_add_private() to G_ADD_PRIVATE()
    
    The former has been deprecated for a long time.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>

 service/dconf-writer.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/service/dconf-writer.c b/service/dconf-writer.c
index f85300c..00d34fe 100644
--- a/service/dconf-writer.c
+++ b/service/dconf-writer.c
@@ -59,6 +59,7 @@ typedef struct
 static void dconf_writer_iface_init (DConfDBusWriterIface *iface);
 
 G_DEFINE_TYPE_WITH_CODE (DConfWriter, dconf_writer, DCONF_DBUS_TYPE_WRITER_SKELETON,
+                         G_ADD_PRIVATE (DConfWriter)
                          G_IMPLEMENT_INTERFACE (DCONF_DBUS_TYPE_WRITER, dconf_writer_iface_init))
 
 static void
@@ -343,7 +344,7 @@ dconf_writer_iface_init (DConfDBusWriterIface *iface)
 static void
 dconf_writer_init (DConfWriter *writer)
 {
-  writer->priv = G_TYPE_INSTANCE_GET_PRIVATE (writer, DCONF_TYPE_WRITER, DConfWriterPrivate);
+  writer->priv = dconf_writer_get_instance_private (writer);
   writer->priv->basepath = g_build_filename (g_get_user_config_dir (), "dconf", NULL);
   writer->priv->native = TRUE;
 }
@@ -379,8 +380,6 @@ dconf_writer_class_init (DConfWriterClass *class)
                                    g_param_spec_string ("name", "name", "name", NULL,
                                                         G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY |
                                                         G_PARAM_WRITABLE));
-
-  g_type_class_add_private (class, sizeof (DConfWriterPrivate));
 }
 
 void


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