From 498b37841f36c86a27b75b97a4fc22053da94ffa Mon Sep 17 00:00:00 2001 From: Wu Xiaotian Date: Sun, 30 Jun 2019 17:33:00 +0800 Subject: pulse: avoid deprecated g_type_class_add_private --- backends/pulse/pulse-device-switch.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'backends/pulse/pulse-device-switch.c') diff --git a/backends/pulse/pulse-device-switch.c b/backends/pulse/pulse-device-switch.c index 4bd32ce..ea0f6fd 100644 --- a/backends/pulse/pulse-device-switch.c +++ b/backends/pulse/pulse-device-switch.c @@ -36,7 +36,7 @@ static void pulse_device_switch_class_init (PulseDeviceSwitchClass *klass); static void pulse_device_switch_init (PulseDeviceSwitch *swtch); static void pulse_device_switch_dispose (GObject *object); -G_DEFINE_TYPE (PulseDeviceSwitch, pulse_device_switch, MATE_MIXER_TYPE_DEVICE_SWITCH) +G_DEFINE_TYPE_WITH_PRIVATE (PulseDeviceSwitch, pulse_device_switch, MATE_MIXER_TYPE_DEVICE_SWITCH) static gboolean pulse_device_switch_set_active_option (MateMixerSwitch *mms, MateMixerSwitchOption *mmso); @@ -60,16 +60,12 @@ pulse_device_switch_class_init (PulseDeviceSwitchClass *klass) switch_class = MATE_MIXER_SWITCH_CLASS (klass); switch_class->set_active_option = pulse_device_switch_set_active_option; switch_class->list_options = pulse_device_switch_list_options; - - g_type_class_add_private (G_OBJECT_CLASS (klass), sizeof (PulseDeviceSwitchPrivate)); } static void pulse_device_switch_init (PulseDeviceSwitch *swtch) { - swtch->priv = G_TYPE_INSTANCE_GET_PRIVATE (swtch, - PULSE_TYPE_DEVICE_SWITCH, - PulseDeviceSwitchPrivate); + swtch->priv = pulse_device_switch_get_instance_private (swtch); } static void -- cgit v1.2.1