[rygel/wip/meson: 51/52] examples: Remove g_type_class_add_private



commit e801a76ec13e9959ccd8739939e5486829659684
Author: Jens Georg <mail jensge org>
Date:   Mon Oct 22 22:29:35 2018 +0200

    examples: Remove g_type_class_add_private

 examples/renderer-plugins/C/example-player.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/examples/renderer-plugins/C/example-player.c b/examples/renderer-plugins/C/example-player.c
index c802e3cc..b4304577 100644
--- a/examples/renderer-plugins/C/example-player.c
+++ b/examples/renderer-plugins/C/example-player.c
@@ -130,10 +130,6 @@ static void
 rygel_example_player_finalize (GObject *obj);
 
 
-G_DEFINE_TYPE_WITH_CODE (RygelExamplePlayer, rygel_example_player, G_TYPE_OBJECT,
-                         G_IMPLEMENT_INTERFACE (RYGEL_TYPE_MEDIA_PLAYER,
-                                                rygel_example_player_rygel_media_player_interface_init))
-
 struct _RygelExamplePlayerPrivate {
   gchar *_playback_state;
   gchar *_uri;
@@ -146,6 +142,12 @@ struct _RygelExamplePlayerPrivate {
   gchar *playback_speed;
   gchar *user_agent;
 };
+typedef struct _RygelExamplePlayerPrivate RygelExamplePlayerPrivate;
+
+G_DEFINE_TYPE_WITH_CODE (RygelExamplePlayer, rygel_example_player, G_TYPE_OBJECT,
+                         G_ADD_PRIVATE(RygelExamplePlayer)
+                         G_IMPLEMENT_INTERFACE (RYGEL_TYPE_MEDIA_PLAYER,
+                                                rygel_example_player_rygel_media_player_interface_init))
 
 static const gchar* RYGEL_EXAMPLE_PLAYER_PROTOCOLS[] = {"http-get", NULL};
 static const gchar* RYGEL_EXAMPLE_PLAYER_MIME_TYPES[] = {"image/jpeg", "image/png", NULL};
@@ -190,8 +192,6 @@ static void
 rygel_example_player_class_init (RygelExamplePlayerClass *klass) {
   GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-  g_type_class_add_private (gobject_class, sizeof (RygelExamplePlayerPrivate));
-
   gobject_class->get_property = _rygel_example_player_get_property;
   gobject_class->set_property = _rygel_example_player_set_property;
   gobject_class->finalize = rygel_example_player_finalize;


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