summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrbuj <[email protected]>2022-08-03 14:27:13 +0200
committerLuke from DC <[email protected]>2022-08-04 19:26:40 +0000
commitf26a8624156376794f5e505c249eff6c1924fc1b (patch)
treeefc77b03695a9dfa6d16a5c3694886b86c7abc34
parente9d03be8a4a23c411df1a5a2c6fb2284dd5df22f (diff)
downloadcaja-extensions-master.tar.bz2
caja-extensions-master.tar.xz
bacon-video-widget-properties: fix warning 'g_type_class_add_private' is deprecatedHEADmaster
-rw-r--r--audio-video-properties/bacon-video-widget-properties.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/audio-video-properties/bacon-video-widget-properties.c b/audio-video-properties/bacon-video-widget-properties.c
index 8175e07..a633aef 100644
--- a/audio-video-properties/bacon-video-widget-properties.c
+++ b/audio-video-properties/bacon-video-widget-properties.c
@@ -36,24 +36,20 @@ struct BaconVideoWidgetPropertiesPrivate {
int time;
};
-#define BACON_VIDEO_WIDGET_PROPERTIES_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesPrivate))
-
-G_DEFINE_TYPE (BaconVideoWidgetProperties, bacon_video_widget_properties, GTK_TYPE_BOX)
+G_DEFINE_TYPE_WITH_PRIVATE (BaconVideoWidgetProperties, bacon_video_widget_properties, GTK_TYPE_BOX)
static void
bacon_video_widget_properties_class_init (BaconVideoWidgetPropertiesClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (BaconVideoWidgetPropertiesPrivate));
-
object_class->dispose = bacon_video_widget_properties_dispose;
}
static void
bacon_video_widget_properties_init (BaconVideoWidgetProperties *props)
{
- props->priv = G_TYPE_INSTANCE_GET_PRIVATE (props, BACON_TYPE_VIDEO_WIDGET_PROPERTIES, BaconVideoWidgetPropertiesPrivate);
+ props->priv = bacon_video_widget_properties_get_instance_private (props);
gtk_orientable_set_orientation (GTK_ORIENTABLE (props), GTK_ORIENTATION_VERTICAL);
}
@@ -61,11 +57,14 @@ bacon_video_widget_properties_init (BaconVideoWidgetProperties *props)
static void
bacon_video_widget_properties_dispose (GObject *object)
{
- BaconVideoWidgetPropertiesPrivate *priv = BACON_VIDEO_WIDGET_PROPERTIES_GET_PRIVATE (object);
+ BaconVideoWidgetProperties *props;
+
+ g_return_if_fail (object != NULL);
+ g_return_if_fail (BACON_IS_VIDEO_WIDGET_PROPERTIES (object));
+
+ props = BACON_VIDEO_WIDGET_PROPERTIES (object);
- if (priv->xml != NULL)
- g_object_unref (priv->xml);
- priv->xml = NULL;
+ g_clear_object (&props->priv->xml);
G_OBJECT_CLASS (bacon_video_widget_properties_parent_class)->dispose (object);
}