diff options
author | Frederic Peters <fpeters@src.gnome.org> | 2009-01-30 18:43:15 +0800 |
---|---|---|
committer | Frederic Peters <fpeters@src.gnome.org> | 2009-01-30 18:43:15 +0800 |
commit | 2c5160bcb91ee9d808f283458b8a7a9740c70672 (patch) | |
tree | 2e91c882f225bfa8a98bfc0514815d75cc9e45dd /libempathy/empathy-account-manager.c | |
parent | c3b3c32044834f1b417fb4a44d8daced5583fcf8 (diff) | |
download | gsoc2013-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/empathy-account-manager.c')
-rw-r--r-- | libempathy/empathy-account-manager.c | 22 |
1 files changed, 20 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); +} |