[libsoup/wip/withprivate: 8/26] auth-manager: port to the new private api



commit 01a52933b4f54cbcdd449ca731f432734b20907b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Nov 7 10:32:53 2016 +0100

    auth-manager: port to the new private api

 libsoup/soup-auth-manager.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libsoup/soup-auth-manager.c b/libsoup/soup-auth-manager.c
index 9455265..703d188 100644
--- a/libsoup/soup-auth-manager.c
+++ b/libsoup/soup-auth-manager.c
@@ -60,9 +60,6 @@ enum {
 
 static guint signals[LAST_SIGNAL] = { 0 };
 
-G_DEFINE_TYPE_WITH_CODE (SoupAuthManager, soup_auth_manager, G_TYPE_OBJECT,
-                        G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE,
-                                               soup_auth_manager_session_feature_init))
 
 struct SoupAuthManagerPrivate {
        SoupSession *session;
@@ -80,6 +77,11 @@ typedef struct {
        GHashTable  *auths;            /* scheme:realm -> SoupAuth */
 } SoupAuthHost;
 
+G_DEFINE_TYPE_WITH_CODE (SoupAuthManager, soup_auth_manager, G_TYPE_OBJECT,
+                         G_ADD_PRIVATE (SoupAuthManager)
+                        G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE,
+                                               soup_auth_manager_session_feature_init))
+
 static void soup_auth_host_free (SoupAuthHost *host);
 static SoupAuth *record_auth_for_uri (SoupAuthManagerPrivate *priv,
                                      SoupURI *uri, SoupAuth *auth,
@@ -90,7 +92,7 @@ soup_auth_manager_init (SoupAuthManager *manager)
 {
        SoupAuthManagerPrivate *priv;
 
-       priv = manager->priv = G_TYPE_INSTANCE_GET_PRIVATE (manager, SOUP_TYPE_AUTH_MANAGER, 
SoupAuthManagerPrivate);
+       priv = manager->priv = soup_auth_manager_get_instance_private (manager);
 
        priv->auth_types = g_ptr_array_new_with_free_func ((GDestroyNotify)g_type_class_unref);
        priv->auth_hosts = g_hash_table_new_full (soup_uri_host_hash,
@@ -121,8 +123,6 @@ soup_auth_manager_class_init (SoupAuthManagerClass *auth_manager_class)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (auth_manager_class);
 
-       g_type_class_add_private (auth_manager_class, sizeof (SoupAuthManagerPrivate));
-
        object_class->finalize = soup_auth_manager_finalize;
 
        /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]