diff options
author | Debarshi Ray <debarshir@gnome.org> | 2017-08-04 14:09:22 +0200 |
---|---|---|
committer | Debarshi Ray <debarshir@gnome.org> | 2017-08-04 14:52:58 +0200 |
commit | d091b23d1acdc108c03386221e2448d6dceb1bec (patch) | |
tree | e2120c742153893b83af09631a59a4701a3c3bc5 | |
parent | f97662e2197e3139712b97a07a523da6c8fe9ba1 (diff) | |
download | librest-d091b23d1acdc108c03386221e2448d6dceb1bec.tar.gz |
rest-proxy-auth: Use G_DEFINE_TYPE_WITH_PRIVATE
https://bugzilla.gnome.org/show_bug.cgi?id=785818
-rw-r--r-- | rest/rest-proxy-auth.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/rest/rest-proxy-auth.c b/rest/rest-proxy-auth.c index 79f21e0..b96e443 100644 --- a/rest/rest-proxy-auth.c +++ b/rest/rest-proxy-auth.c @@ -24,10 +24,7 @@ #include <rest/rest-proxy-auth-private.h> #include "rest-private.h" -G_DEFINE_TYPE (RestProxyAuth, rest_proxy_auth, G_TYPE_OBJECT) - -#define REST_PROXY_AUTH_GET_PRIVATE(o) \ - (G_TYPE_INSTANCE_GET_PRIVATE ((o), REST_TYPE_PROXY_AUTH, RestProxyAuthPrivate)) +#define GET_PRIVATE(o) rest_proxy_auth_get_instance_private(REST_PROXY_AUTH(o)) struct _RestProxyAuthPrivate { /* used to hold state during async authentication */ @@ -38,6 +35,8 @@ struct _RestProxyAuthPrivate { gboolean paused; }; +G_DEFINE_TYPE_WITH_PRIVATE (RestProxyAuth, rest_proxy_auth, G_TYPE_OBJECT) + static void rest_proxy_auth_dispose (GObject *object) { @@ -56,15 +55,13 @@ rest_proxy_auth_class_init (RestProxyAuthClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); - g_type_class_add_private (klass, sizeof (RestProxyAuthPrivate)); - object_class->dispose = rest_proxy_auth_dispose; } static void rest_proxy_auth_init (RestProxyAuth *proxy) { - proxy->priv = REST_PROXY_AUTH_GET_PRIVATE (proxy); + proxy->priv = GET_PRIVATE (proxy); } G_GNUC_INTERNAL RestProxyAuth* |