empathy r2264 - trunk/libempathy
- From: fpeters svn gnome org
- To: svn-commits-list gnome org
- Subject: empathy r2264 - trunk/libempathy
- Date: Fri, 30 Jan 2009 10:43:15 +0000 (UTC)
Author: fpeters
Date: Fri Jan 30 10:43:15 2009
New Revision: 2264
URL: http://svn.gnome.org/viewvc/empathy?rev=2264&view=rev
Log:
Added a new empathy_account_manager_get_count function, to get the number of
accounts.
Modified:
trunk/libempathy/empathy-account-manager.c
trunk/libempathy/empathy-account-manager.h
Modified: trunk/libempathy/empathy-account-manager.c
==============================================================================
--- trunk/libempathy/empathy-account-manager.c (original)
+++ trunk/libempathy/empathy-account-manager.c Fri Jan 30 10:43:15 2009
@@ -162,9 +162,8 @@
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 @@
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);
+}
Modified: trunk/libempathy/empathy-account-manager.h
==============================================================================
--- trunk/libempathy/empathy-account-manager.h (original)
+++ trunk/libempathy/empathy-account-manager.h Fri Jan 30 10:43:15 2009
@@ -59,6 +59,8 @@
gboolean empathy_account_manager_is_account_just_connected
(EmpathyAccountManager *manager,
McAccount *account);
+int empathy_account_manager_get_count
+ (EmpathyAccountManager *manager);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]