summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Karsay <gabor.karsay@gmx.at>2019-09-26 11:33:40 +0200
committerBastien Nocera <hadess@hadess.net>2019-09-26 11:33:40 +0200
commit36fc3ff8628cf9a7d339594a3199a33db3e9112a (patch)
treede5a9880a3351012d3c39d9a133cf315114e1183
parent256a18836cf32b2ae217e51190f090fa9181b9c6 (diff)
downloadtotem-36fc3ff8628cf9a7d339594a3199a33db3e9112a.tar.gz
screenshot: Replace deprecated g_type_class_add_private()
g_type_class_add_private has been deprecated since GObject 2.58.
-rw-r--r--src/plugins/screenshot/totem-gallery-progress.c9
-rw-r--r--src/plugins/screenshot/totem-gallery.c6
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 *