diff options
author | Wu Xiaotian <[email protected]> | 2019-07-01 15:51:42 +0800 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-07-17 04:35:12 +0000 |
commit | 12ef1a821ebb63853b2d2e80f2559feca98bf7dc (patch) | |
tree | 67fc49fd8bc35932a0161c9868f28948e5ebce32 /plugins | |
parent | de2761ddea2ca22cba4bb3668fb4328352210775 (diff) | |
download | mate-settings-daemon-12ef1a821ebb63853b2d2e80f2559feca98bf7dc.tar.bz2 mate-settings-daemon-12ef1a821ebb63853b2d2e80f2559feca98bf7dc.tar.xz |
plugins keyboard: fix deprecated g_type_class_add_private
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/keyboard/msd-keyboard-manager.c | 9 | ||||
-rw-r--r-- | plugins/keyboard/msd-keyboard-plugin.c | 8 |
2 files changed, 4 insertions, 13 deletions
diff --git a/plugins/keyboard/msd-keyboard-manager.c b/plugins/keyboard/msd-keyboard-manager.c index 92450a8..c34b061 100644 --- a/plugins/keyboard/msd-keyboard-manager.c +++ b/plugins/keyboard/msd-keyboard-manager.c @@ -46,9 +46,6 @@ #include "msd-keyboard-xkb.h" -#define MSD_KEYBOARD_MANAGER_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE((o), MSD_TYPE_KEYBOARD_MANAGER, MsdKeyboardManagerPrivate)) - #define MSD_KEYBOARD_SCHEMA "org.mate.peripherals-keyboard" #define KEY_REPEAT "repeat" @@ -74,7 +71,7 @@ static void msd_keyboard_manager_class_init (MsdKeyboardManagerClass* klass static void msd_keyboard_manager_init (MsdKeyboardManager* keyboard_manager); static void msd_keyboard_manager_finalize (GObject* object); -G_DEFINE_TYPE (MsdKeyboardManager, msd_keyboard_manager, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_PRIVATE (MsdKeyboardManager, msd_keyboard_manager, G_TYPE_OBJECT) static gpointer manager_object = NULL; @@ -354,14 +351,12 @@ msd_keyboard_manager_class_init (MsdKeyboardManagerClass *klass) GObjectClass *object_class = G_OBJECT_CLASS (klass); object_class->finalize = msd_keyboard_manager_finalize; - - g_type_class_add_private (klass, sizeof (MsdKeyboardManagerPrivate)); } static void msd_keyboard_manager_init (MsdKeyboardManager *manager) { - manager->priv = MSD_KEYBOARD_MANAGER_GET_PRIVATE (manager); + manager->priv = msd_keyboard_manager_get_instance_private (manager); } static void diff --git a/plugins/keyboard/msd-keyboard-plugin.c b/plugins/keyboard/msd-keyboard-plugin.c index 97ad9ef..ed16759 100644 --- a/plugins/keyboard/msd-keyboard-plugin.c +++ b/plugins/keyboard/msd-keyboard-plugin.c @@ -31,14 +31,12 @@ struct MsdKeyboardPluginPrivate { MsdKeyboardManager *manager; }; -#define MSD_KEYBOARD_PLUGIN_GET_PRIVATE(object) (G_TYPE_INSTANCE_GET_PRIVATE ((object), MSD_TYPE_KEYBOARD_PLUGIN, MsdKeyboardPluginPrivate)) - -MATE_SETTINGS_PLUGIN_REGISTER (MsdKeyboardPlugin, msd_keyboard_plugin) +MATE_SETTINGS_PLUGIN_REGISTER_WITH_PRIVATE (MsdKeyboardPlugin, msd_keyboard_plugin) static void msd_keyboard_plugin_init (MsdKeyboardPlugin *plugin) { - plugin->priv = MSD_KEYBOARD_PLUGIN_GET_PRIVATE (plugin); + plugin->priv = msd_keyboard_plugin_get_instance_private (plugin); g_debug ("MsdKeyboardPlugin initializing"); @@ -99,8 +97,6 @@ msd_keyboard_plugin_class_init (MsdKeyboardPluginClass *klass) plugin_class->activate = impl_activate; plugin_class->deactivate = impl_deactivate; - - g_type_class_add_private (klass, sizeof (MsdKeyboardPluginPrivate)); } static void |