[frogr] Avoid extra call to frogr_config_save_accounts ()



commit 7953d5ec2f8efa882c15387f3b03356974df073a
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Sun Apr 8 00:55:15 2012 +0200

    Avoid extra call to frogr_config_save_accounts ()

 src/frogr-controller.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 9f19da6..2a1b9e7 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -546,19 +546,20 @@ _exchange_token_cb (GObject *object, GAsyncResult *result, gpointer data)
   fsp_session_exchange_token_finish (session, result, &error);
   if (error == NULL)
     {
+      const gchar *token = NULL;
+      const gchar *token_secret = NULL;
+
       /* If everything went fine, get the token and secret from the
          session and update the current user account */
-      frogr_account_set_token (priv->account,
-                               fsp_session_get_token (priv->session));
-      frogr_account_set_token_secret (priv->account,
-                                      fsp_session_get_token_secret (priv->session));
+      token = fsp_session_get_token (priv->session);
+      frogr_account_set_token (priv->account, token);
+
+      token_secret = fsp_session_get_token_secret (priv->session);
+      frogr_account_set_token_secret (priv->account, token_secret);
 
       /* Make sure we update the version for the account too */
       frogr_account_set_version (priv->account, ACCOUNTS_CURRENT_VERSION);
 
-      /* Update accounts on disk */
-      frogr_config_save_accounts (priv->config);
-
       /* Finally, try to set the active account again */
       frogr_controller_set_active_account (controller, priv->account);
     }



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