summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Karsay <gabor.karsay@gmx.at>2019-09-26 11:33:55 +0200
committerBastien Nocera <hadess@hadess.net>2019-09-26 11:33:55 +0200
commit3642605d9b5ed9b75d5e7d874a8c0df4aef87047 (patch)
tree2edff37af0ee284881eec2c336f963dc823abf24
parent36fc3ff8628cf9a7d339594a3199a33db3e9112a (diff)
downloadtotem-3642605d9b5ed9b75d5e7d874a8c0df4aef87047.tar.gz
skipto: Replace deprecated g_type_class_add_private()
g_type_class_add_private has been deprecated since GObject 2.58.
-rw-r--r--src/plugins/skipto/totem-skipto.c7
-rw-r--r--src/plugins/skipto/totem-time-entry.c6
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);