aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libempathy/empathy-account-manager.c22
-rw-r--r--libempathy/empathy-account-manager.h2
2 files changed, 22 insertions, 2 deletions
diff --git a/libempathy/empathy-account-manager.c b/libempathy/empathy-account-manager.c
index 26017c97f..5c86e29b2 100644
--- a/libempathy/empathy-account-manager.c
+++ b/libempathy/empathy-account-manager.c
@@ -162,9 +162,8 @@ account_deleted_cb (McAccountMonitor *mon,
if (account)
{
- g_signal_emit (manager, signals[ACCOUNT_DELETED], 0, account);
-
g_hash_table_remove (priv->accounts, account);
+ g_signal_emit (manager, signals[ACCOUNT_DELETED], 0, account);
g_object_unref (account);
}
}
@@ -621,3 +620,22 @@ empathy_account_manager_is_account_just_connected (EmpathyAccountManager *manage
return (data->source_id > 0);
}
+/**
+ * empathy_account_manager_get_count:
+ * @manager: a #EmpathyAccountManager
+ *
+ * Get the number of accounts.
+ *
+ * Returns: the number of accounts.
+ **/
+int
+empathy_account_manager_get_count (EmpathyAccountManager *manager)
+{
+ EmpathyAccountManagerPriv *priv;
+
+ g_return_val_if_fail (EMPATHY_IS_ACCOUNT_MANAGER (manager), 0);
+
+ priv = GET_PRIV (manager);
+
+ return g_hash_table_size (priv->accounts);
+}
diff --git a/libempathy/empathy-account-manager.h b/libempathy/empathy-account-manager.h
index 58d977fc5..b9aecb09f 100644
--- a/libempathy/empathy-account-manager.h
+++ b/libempathy/empathy-account-manager.h
@@ -59,6 +59,8 @@ int empathy_account_manager_get_connecting_accounts
gboolean empathy_account_manager_is_account_just_connected
(EmpathyAccountManager *manager,
McAccount *account);
+int empathy_account_manager_get_count
+ (EmpathyAccountManager *manager);
G_END_DECLS