[gnome-online-accounts/gnome-3-20] identity: Minor clean up



commit 18b28ba0f5602269cc5575e14d98885d407d0ce5
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri May 20 16:25:44 2016 +0200

    identity: Minor clean up
    
    There is no need to keep the GoaManager pointer as an instance
    variable. We can just get it when adding the account. There are too
    many manager-like variables flying around. This makes the code more
    readable by keeping one of them closely tied to its context.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=766733

 src/goaidentity/goaidentityservice.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/goaidentity/goaidentityservice.c b/src/goaidentity/goaidentityservice.c
index f488767..0c551ca 100644
--- a/src/goaidentity/goaidentityservice.c
+++ b/src/goaidentity/goaidentityservice.c
@@ -48,7 +48,6 @@ struct _GoaIdentityServicePrivate
   GHashTable               *pending_temporary_account_results;
 
   GoaClient                *client;
-  GoaManager               *accounts_manager;
 };
 
 static void identity_service_manager_interface_init (GoaIdentityServiceManagerIface *interface);
@@ -892,6 +891,7 @@ add_temporary_account (GoaIdentityService *self,
   GSimpleAsyncResult *operation_result;
   GVariantBuilder     credentials;
   GVariantBuilder     details;
+  GoaManager         *manager;
   GoaObject *object;
 
   principal = goa_identity_get_identifier (identity);
@@ -934,7 +934,8 @@ add_temporary_account (GoaIdentityService *self,
                        g_strdup (principal),
                        g_object_ref (operation_result));
 
-  goa_manager_call_add_account (self->priv->accounts_manager,
+  manager = goa_client_get_manager (self->priv->client);
+  goa_manager_call_add_account (manager,
                                 "kerberos",
                                 principal,
                                 principal,
@@ -1706,8 +1707,6 @@ on_got_client (GoaClient          *client,
       goto out;
     }
 
-  self->priv->accounts_manager = goa_client_get_manager (client);
-
   self->priv->identity_manager = goa_kerberos_identity_manager_new (NULL, &error);
 
   if (self->priv->identity_manager == NULL)


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