summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Dasmohapatra <vivek@collabora.co.uk>2010-03-24 15:36:07 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2010-04-14 13:37:40 +0100
commitfb4077a47c7e9509e9580020159df07dac6278d1 (patch)
tree4f6097fe8c5a1aebc28ac6253c8403e0e80bdc0e
parenta40571a5a56fe6f012d41fb48a00ee24881c1760 (diff)
downloadtelepathy-mission-control-fb4077a47c7e9509e9580020159df07dac6278d1.tar.gz
Incomplete accounts resulted in account manager load locks never being released.
This meant that the account manager's dbus name was never claimed, as it sat around forever waiting for the account's manager to become ready, (or fail) but this could never happen as the incomplete account didn't have a manager at all.
-rw-r--r--src/mcd-account.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/mcd-account.c b/src/mcd-account.c
index 32eddc9e..7cd78d99 100644
--- a/src/mcd-account.c
+++ b/src/mcd-account.c
@@ -2703,17 +2703,29 @@ mcd_account_setup (McdAccount *account)
McdAccountPrivate *priv = account->priv;
priv->keyfile = mcd_account_manager_get_config (priv->account_manager);
- if (!priv->keyfile) return FALSE;
+ if (!priv->keyfile)
+ {
+ g_error ("Could not find internal data");
+ goto broken_account;
+ }
priv->manager_name =
g_key_file_get_string (priv->keyfile, priv->unique_name,
MC_ACCOUNTS_KEY_MANAGER, NULL);
- if (!priv->manager_name) return FALSE;
+ if (!priv->manager_name)
+ {
+ g_warning ("Account has no manager");
+ goto broken_account;
+ }
priv->protocol_name =
g_key_file_get_string (priv->keyfile, priv->unique_name,
MC_ACCOUNTS_KEY_PROTOCOL, NULL);
- if (!priv->protocol_name) return FALSE;
+ if (!priv->protocol_name)
+ {
+ g_warning ("Account has no protocol");
+ goto broken_account;
+ }
priv->object_path = g_strconcat (MC_ACCOUNT_DBUS_OBJECT_BASE,
priv->unique_name, NULL);
@@ -2769,8 +2781,20 @@ mcd_account_setup (McdAccount *account)
mcd_account_loaded (account);
}
+ /* even though the manager is absent or unusable, we still register *
+ * the accounts dbus name as it is otherwise acceptably configured */
+
_mcd_account_load (account, register_dbus_service, NULL);
return TRUE;
+
+broken_account:
+ /* normally, various callbacks would release locks when the manager *
+ * became ready: however, this cannot happen for an incomplete account *
+ * as it never gets a manager: We therefore invoke the account callbacks *
+ * right now so the account manager doesn't hang around forever waiting *
+ * for an event that cannot happen (at least until the account is fixed) */
+ mcd_account_loaded (account);
+ return FALSE;
}
static void