gboolean ready;
GoaClient *client;
- GHashTable *accounts; /* alloc'ed string -> ref'ed GoaAccount */
+ GHashTable *accounts; /* alloc'ed string -> ref'ed GoaObject */
};
static void
_new_account (McpAccountManagerGoa *self,
- GoaAccount *account)
+ GoaObject *object)
{
+ GoaAccount *account = goa_object_peek_account (object);
char *account_name = get_tp_account_name (account);
if (account_name == NULL)
/* @account_name now is owned by the hash table */
g_hash_table_insert (self->priv->accounts, account_name,
- g_object_ref (account));
+ g_object_ref (object));
if (self->priv->ready)
g_signal_emit_by_name (self, "created", account_name);
GoaObject *object,
McpAccountManagerGoa *self)
{
- GoaAccount *account = goa_object_peek_account (object);
-
- _new_account (self, account);
+ _new_account (self, object);
}
for (ptr = accounts; ptr != NULL; ptr = ptr->next)
{
- GoaAccount *account = goa_object_peek_account (ptr->data);
-
- _new_account (self, account);
+ _new_account (self, ptr->data);
}
g_list_free_full (accounts, g_object_unref);
const gchar *key)
{
McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
+ GoaObject *object;
GoaAccount *account;
DEBUG ("%s: %s, %s", G_STRFUNC, acct, key);
- account = g_hash_table_lookup (priv->accounts, acct);
+ object = g_hash_table_lookup (priv->accounts, acct);
+
+ if (object == NULL)
+ return FALSE;
+
+ account = goa_object_peek_account (object);
if (account == NULL)
return FALSE;
GValue *identifier)
{
McpAccountManagerGoaPrivate *priv = GET_PRIVATE (self);
+ GoaObject *object;
GoaAccount *account;
- account = g_hash_table_lookup (priv->accounts, acct);
+ object = g_hash_table_lookup (priv->accounts, acct);
+ g_return_if_fail (object != NULL);
+ account = goa_object_peek_account (object);
g_return_if_fail (account != NULL);
g_value_init (identifier, G_TYPE_STRING);