[totem/gkarsay/totem-master: 3/6] screenshot: Replace deprecated g_type_class_add_private()



commit 36fc3ff8628cf9a7d339594a3199a33db3e9112a
Author: Gabor Karsay <gabor karsay gmx at>
Date:   Thu Sep 26 11:33:40 2019 +0200

    screenshot: Replace deprecated g_type_class_add_private()
    
    g_type_class_add_private has been deprecated since GObject 2.58.

 src/plugins/screenshot/totem-gallery-progress.c | 9 +++------
 src/plugins/screenshot/totem-gallery.c          | 6 ++----
 2 files changed, 5 insertions(+), 10 deletions(-)
---
diff --git a/src/plugins/screenshot/totem-gallery-progress.c b/src/plugins/screenshot/totem-gallery-progress.c
index 818f02326..a57fa83e2 100644
--- a/src/plugins/screenshot/totem-gallery-progress.c
+++ b/src/plugins/screenshot/totem-gallery-progress.c
@@ -48,29 +48,26 @@ struct _TotemGalleryProgressPrivate {
        GtkProgressBar *progress_bar;
 };
 
-G_DEFINE_TYPE (TotemGalleryProgress, totem_gallery_progress, GTK_TYPE_DIALOG)
-#define TOTEM_GALLERY_PROGRESS_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), 
TOTEM_TYPE_GALLERY_PROGRESS, TotemGalleryProgressPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (TotemGalleryProgress, totem_gallery_progress, GTK_TYPE_DIALOG)
 
 static void
 totem_gallery_progress_class_init (TotemGalleryProgressClass *klass)
 {
        GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 
-       g_type_class_add_private (klass, sizeof (TotemGalleryProgressPrivate));
-
        gobject_class->finalize = totem_gallery_progress_finalize;
 }
 
 static void
 totem_gallery_progress_init (TotemGalleryProgress *self)
 {
-       self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TOTEM_TYPE_GALLERY_PROGRESS, 
TotemGalleryProgressPrivate);
+       self->priv = totem_gallery_progress_get_instance_private (self);
 }
 
 static void
 totem_gallery_progress_finalize (GObject *object)
 {
-       TotemGalleryProgressPrivate *priv = TOTEM_GALLERY_PROGRESS_GET_PRIVATE (object);
+       TotemGalleryProgressPrivate *priv = TOTEM_GALLERY_PROGRESS (object)->priv;
 
        g_spawn_close_pid (priv->child_pid);
        g_free (priv->output_filename);
diff --git a/src/plugins/screenshot/totem-gallery.c b/src/plugins/screenshot/totem-gallery.c
index d90516513..928261408 100644
--- a/src/plugins/screenshot/totem-gallery.c
+++ b/src/plugins/screenshot/totem-gallery.c
@@ -47,19 +47,17 @@ struct _TotemGalleryPrivate {
        GtkSpinButton *screenshot_width;
 };
 
-G_DEFINE_TYPE (TotemGallery, totem_gallery, GTK_TYPE_FILE_CHOOSER_DIALOG)
-#define TOTEM_GALLERY_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TOTEM_TYPE_GALLERY, 
TotemGalleryPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (TotemGallery, totem_gallery, GTK_TYPE_FILE_CHOOSER_DIALOG)
 
 static void
 totem_gallery_class_init (TotemGalleryClass *klass)
 {
-       g_type_class_add_private (klass, sizeof (TotemGalleryPrivate));
 }
 
 static void
 totem_gallery_init (TotemGallery *self)
 {
-       self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TOTEM_TYPE_GALLERY, TotemGalleryPrivate);
+       self->priv = totem_gallery_get_instance_private (self);
 }
 
 TotemGallery *


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