diff options
author | Wu Xiaotian <[email protected]> | 2019-01-09 22:07:13 +0800 |
---|---|---|
committer | lukefromdc <[email protected]> | 2019-01-12 01:43:18 +0000 |
commit | 9fc6f1f3314f2511249af0a7ce04a255a57c0066 (patch) | |
tree | 45ee8cb8176fa6221f326e2a673dffcfc5f64916 | |
parent | 9991fb1762bd44762c4ee43b2484f30114a307d4 (diff) | |
download | caja-9fc6f1f3314f2511249af0a7ce04a255a57c0066.tar.bz2 caja-9fc6f1f3314f2511249af0a7ce04a255a57c0066.tar.xz |
[libegg] Avoid deprecated g_type_class_add_private
With minimal changes to avoid deprecated g_type_class_add_private
-rw-r--r-- | libegg/eggsmclient.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libegg/eggsmclient.c b/libegg/eggsmclient.c index 84848921..72432555 100644 --- a/libegg/eggsmclient.c +++ b/libegg/eggsmclient.c @@ -48,7 +48,8 @@ struct _EggSMClientPrivate #define EGG_SM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_SM_CLIENT, EggSMClientPrivate)) -G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT) +G_DEFINE_TYPE_WITH_CODE (EggSMClient, egg_sm_client, G_TYPE_OBJECT, + G_ADD_PRIVATE (EggSMClient)) static EggSMClient *global_client; static EggSMClientMode global_client_mode = EGG_SM_CLIENT_MODE_NORMAL; @@ -72,8 +73,6 @@ egg_sm_client_class_init (EggSMClientClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (EggSMClientPrivate)); - /** * EggSMClient::save_state: * @client: the client @@ -413,7 +412,7 @@ egg_sm_client_is_resumed (EggSMClient *client) GKeyFile * egg_sm_client_get_state_file (EggSMClient *client) { - EggSMClientPrivate *priv = EGG_SM_CLIENT_GET_PRIVATE (client); + EggSMClientPrivate *priv = egg_sm_client_get_instance_private (client); char *state_file_path; GError *err = NULL; |