aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorFrederic Peters <fpeters@src.gnome.org>2009-01-30 18:43:15 +0800
committerFrederic Peters <fpeters@src.gnome.org>2009-01-30 18:43:15 +0800
commit2c5160bcb91ee9d808f283458b8a7a9740c70672 (patch)
tree2e91c882f225bfa8a98bfc0514815d75cc9e45dd /libempathy
parentc3b3c32044834f1b417fb4a44d8daced5583fcf8 (diff)
downloadgsoc2013-empathy-2c5160bcb91ee9d808f283458b8a7a9740c70672.tar
gsoc2013-empathy-2c5160bcb91ee9d808f283458b8a7a9740c70672.tar.gz
gsoc2013-empathy-2c5160bcb91ee9d808f283458b8a7a9740c70672.tar.bz2
gsoc2013-empathy-2c5160bcb91ee9d808f283458b8a7a9740c70672.tar.lz
gsoc2013-empathy-2c5160bcb91ee9d808f283458b8a7a9740c70672.tar.xz
gsoc2013-empathy-2c5160bcb91ee9d808f283458b8a7a9740c70672.tar.zst
gsoc2013-empathy-2c5160bcb91ee9d808f283458b8a7a9740c70672.zip
Added a new empathy_account_manager_get_count function, to get the number of
accounts. svn path=/trunk/; revision=2264
Diffstat (limited to 'libempathy')
-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