[frogr] Fix issues initializing the active account.
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [frogr] Fix issues initializing the active account.
- Date: Sun, 8 Apr 2012 01:02:25 +0000 (UTC)
commit 4aba4bd1c69fdf02747227f4212c3d59a8919d56
Author: Mario Sanchez Prada <msanchez igalia com>
Date: Sun Apr 8 00:58:21 2012 +0200
Fix issues initializing the active account.
Call frogr_controller_set_active_account in frogr_controller_run_app
instead of doing it in frogr_controller_init, where basic
initialization of priv->account and tokens in the FspSession object
should be done.
src/frogr-controller.c | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
---
diff --git a/src/frogr-controller.c b/src/frogr-controller.c
index 2a1b9e7..2e28e60 100644
--- a/src/frogr-controller.c
+++ b/src/frogr-controller.c
@@ -2091,7 +2091,6 @@ static void
frogr_controller_init (FrogrController *self)
{
FrogrControllerPrivate *priv = FROGR_CONTROLLER_GET_PRIVATE (self);
- FrogrAccount *account = NULL;
/* Default variables */
priv->state = FROGR_STATE_IDLE;
@@ -2123,9 +2122,22 @@ frogr_controller_init (FrogrController *self)
priv->tags_fetched = FALSE;
/* Get account, if any */
- account = frogr_config_get_active_account (priv->config);
- if (account)
- frogr_controller_set_active_account (self, account);
+ priv->account = frogr_config_get_active_account (priv->config);
+ if (priv->account)
+ {
+ const gchar *token = NULL;
+ const gchar *token_secret = NULL;
+
+ g_object_ref (priv->account);
+
+ /* If available, set token */
+ token = frogr_account_get_token (priv->account);
+ fsp_session_set_token (priv->session, token);
+
+ /* If available, set token secret */
+ token_secret = frogr_account_get_token_secret (priv->account);
+ fsp_session_set_token_secret (priv->session, token_secret);
+ }
/* Set HTTP proxy if needed */
if (frogr_config_get_use_proxy (priv->config))
@@ -2167,6 +2179,7 @@ gboolean
frogr_controller_run_app (FrogrController *self)
{
FrogrControllerPrivate *priv = NULL;
+ FrogrAccount *account = NULL;
g_return_val_if_fail(FROGR_IS_CONTROLLER (self), FALSE);
@@ -2185,12 +2198,13 @@ frogr_controller_run_app (FrogrController *self)
/* Update flag */
priv->app_running = TRUE;
- /* Try to pre-fetch some data from the server right after launch */
- _fetch_everything (self, TRUE);
-
/* Start on idle state */
_set_state (self, FROGR_STATE_IDLE);
+ account = frogr_config_get_active_account (priv->config);
+ if (account)
+ frogr_controller_set_active_account (self, account);
+
/* Run UI */
gtk_main ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]