[libsoup/wip/withprivate: 5/26] auth-domain-basic: port to the new private api
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/wip/withprivate: 5/26] auth-domain-basic: port to the new private api
- Date: Mon, 7 Nov 2016 15:06:32 +0000 (UTC)
commit 9133d999c8de6682fd6f2142e507e769f5d7fe57
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Nov 7 10:25:02 2016 +0100
auth-domain-basic: port to the new private api
libsoup/soup-auth-domain-basic.c | 16 ++++++----------
1 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/libsoup/soup-auth-domain-basic.c b/libsoup/soup-auth-domain-basic.c
index b843ad7..aef2f68 100644
--- a/libsoup/soup-auth-domain-basic.c
+++ b/libsoup/soup-auth-domain-basic.c
@@ -37,9 +37,7 @@ typedef struct {
GDestroyNotify auth_dnotify;
} SoupAuthDomainBasicPrivate;
-#define SOUP_AUTH_DOMAIN_BASIC_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o),
SOUP_TYPE_AUTH_DOMAIN_BASIC, SoupAuthDomainBasicPrivate))
-
-G_DEFINE_TYPE (SoupAuthDomainBasic, soup_auth_domain_basic, SOUP_TYPE_AUTH_DOMAIN)
+G_DEFINE_TYPE_WITH_PRIVATE (SoupAuthDomainBasic, soup_auth_domain_basic, SOUP_TYPE_AUTH_DOMAIN)
static void
soup_auth_domain_basic_init (SoupAuthDomainBasic *basic)
@@ -50,7 +48,7 @@ static void
soup_auth_domain_basic_finalize (GObject *object)
{
SoupAuthDomainBasicPrivate *priv =
- SOUP_AUTH_DOMAIN_BASIC_GET_PRIVATE (object);
+ soup_auth_domain_basic_get_instance_private (SOUP_AUTH_DOMAIN_BASIC (object));
if (priv->auth_dnotify)
priv->auth_dnotify (priv->auth_data);
@@ -63,7 +61,7 @@ soup_auth_domain_basic_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
SoupAuthDomainBasicPrivate *priv =
- SOUP_AUTH_DOMAIN_BASIC_GET_PRIVATE (object);
+ soup_auth_domain_basic_get_instance_private (SOUP_AUTH_DOMAIN_BASIC (object));
switch (prop_id) {
case PROP_AUTH_CALLBACK:
@@ -87,7 +85,7 @@ soup_auth_domain_basic_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
SoupAuthDomainBasicPrivate *priv =
- SOUP_AUTH_DOMAIN_BASIC_GET_PRIVATE (object);
+ soup_auth_domain_basic_get_instance_private (SOUP_AUTH_DOMAIN_BASIC (object));
switch (prop_id) {
case PROP_AUTH_CALLBACK:
@@ -181,7 +179,7 @@ soup_auth_domain_basic_set_auth_callback (SoupAuthDomain *domain,
GDestroyNotify dnotify)
{
SoupAuthDomainBasicPrivate *priv =
- SOUP_AUTH_DOMAIN_BASIC_GET_PRIVATE (domain);
+ soup_auth_domain_basic_get_instance_private (SOUP_AUTH_DOMAIN_BASIC (domain));
if (priv->auth_dnotify)
priv->auth_dnotify (priv->auth_data);
@@ -234,7 +232,7 @@ soup_auth_domain_basic_accepts (SoupAuthDomain *domain, SoupMessage *msg,
const char *header)
{
SoupAuthDomainBasicPrivate *priv =
- SOUP_AUTH_DOMAIN_BASIC_GET_PRIVATE (domain);
+ soup_auth_domain_basic_get_instance_private (SOUP_AUTH_DOMAIN_BASIC (domain));
char *username, *password;
gboolean ok = FALSE;
@@ -299,8 +297,6 @@ soup_auth_domain_basic_class_init (SoupAuthDomainBasicClass *basic_class)
SOUP_AUTH_DOMAIN_CLASS (basic_class);
GObjectClass *object_class = G_OBJECT_CLASS (basic_class);
- g_type_class_add_private (basic_class, sizeof (SoupAuthDomainBasicPrivate));
-
auth_domain_class->accepts = soup_auth_domain_basic_accepts;
auth_domain_class->challenge = soup_auth_domain_basic_challenge;
auth_domain_class->check_password = soup_auth_domain_basic_check_password;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]