[totem/gkarsay/totem-master: 4/6] skipto: Replace deprecated g_type_class_add_private()
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem/gkarsay/totem-master: 4/6] skipto: Replace deprecated g_type_class_add_private()
- Date: Thu, 26 Sep 2019 09:35:14 +0000 (UTC)
commit 3642605d9b5ed9b75d5e7d874a8c0df4aef87047
Author: Gabor Karsay <gabor karsay gmx at>
Date: Thu Sep 26 11:33:55 2019 +0200
skipto: Replace deprecated g_type_class_add_private()
g_type_class_add_private has been deprecated since GObject 2.58.
src/plugins/skipto/totem-skipto.c | 7 ++-----
src/plugins/skipto/totem-time-entry.c | 6 ++----
2 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/src/plugins/skipto/totem-skipto.c b/src/plugins/skipto/totem-skipto.c
index 8314db28a..f21b199f3 100644
--- a/src/plugins/skipto/totem-skipto.c
+++ b/src/plugins/skipto/totem-skipto.c
@@ -55,8 +55,7 @@ struct TotemSkiptoPrivate {
gpointer class_ref;
};
-G_DEFINE_TYPE (TotemSkipto, totem_skipto, GTK_TYPE_DIALOG)
-#define TOTEM_SKIPTO_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), TOTEM_TYPE_SKIPTO,
TotemSkiptoPrivate))
+G_DEFINE_TYPE_WITH_PRIVATE (TotemSkipto, totem_skipto, GTK_TYPE_DIALOG)
#define WID(x) (gtk_builder_get_object (skipto->priv->xml, x))
@@ -65,8 +64,6 @@ totem_skipto_class_init (TotemSkiptoClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (TotemSkiptoPrivate));
-
object_class->dispose = totem_skipto_dispose;
}
@@ -82,7 +79,7 @@ totem_skipto_response_cb (GtkDialog *dialog, gint response_id, gpointer data)
static void
totem_skipto_init (TotemSkipto *skipto)
{
- skipto->priv = TOTEM_SKIPTO_GET_PRIVATE (skipto);
+ skipto->priv = totem_skipto_get_instance_private (skipto);
gtk_dialog_set_default_response (GTK_DIALOG (skipto), GTK_RESPONSE_OK);
g_signal_connect (skipto, "response",
diff --git a/src/plugins/skipto/totem-time-entry.c b/src/plugins/skipto/totem-time-entry.c
index dab27b0b2..eb03f17e3 100644
--- a/src/plugins/skipto/totem-time-entry.c
+++ b/src/plugins/skipto/totem-time-entry.c
@@ -47,7 +47,7 @@ struct TotemTimeEntryPrivate {
gulong adjustment_changed_signal;
};
-G_DEFINE_TYPE (TotemTimeEntry, totem_time_entry, GTK_TYPE_SPIN_BUTTON)
+G_DEFINE_TYPE_WITH_PRIVATE (TotemTimeEntry, totem_time_entry, GTK_TYPE_SPIN_BUTTON)
static gint64
totem_string_to_time (const char *time_string)
@@ -76,15 +76,13 @@ totem_time_entry_class_init (TotemTimeEntryClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (TotemTimeEntryPrivate));
-
object_class->dispose = dispose;
}
static void
totem_time_entry_init (TotemTimeEntry *self)
{
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, TOTEM_TYPE_TIME_ENTRY, TotemTimeEntryPrivate);
+ self->priv = totem_time_entry_get_instance_private (self);
/* Connect to signals */
g_signal_connect (self, "output", G_CALLBACK (output_cb), NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]