aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:47:00 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:47:00 +0800
commit851ee222de80d06e7c1b5d9b80951cff203aca7c (patch)
tree5a2d392e1b31dbc4cc3d2375c60bb2c4f3f2525d /src
parent4e6eb8852b873cebc9b8fd6d4df7bdffc57117c2 (diff)
downloadgsoc2013-empathy-851ee222de80d06e7c1b5d9b80951cff203aca7c.tar
gsoc2013-empathy-851ee222de80d06e7c1b5d9b80951cff203aca7c.tar.gz
gsoc2013-empathy-851ee222de80d06e7c1b5d9b80951cff203aca7c.tar.bz2
gsoc2013-empathy-851ee222de80d06e7c1b5d9b80951cff203aca7c.tar.lz
gsoc2013-empathy-851ee222de80d06e7c1b5d9b80951cff203aca7c.tar.xz
gsoc2013-empathy-851ee222de80d06e7c1b5d9b80951cff203aca7c.tar.zst
gsoc2013-empathy-851ee222de80d06e7c1b5d9b80951cff203aca7c.zip
Port EmpathyAccountsDialog to use the cached values to get the number of
connecting accounts. svn path=/trunk/; revision=2044
Diffstat (limited to 'src')
-rw-r--r--src/empathy-accounts-dialog.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index c1e59da57..0816128ea 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -128,7 +128,6 @@ static gboolean accounts_dialog_row_changed_foreach (GtkTreeModel
GtkTreeIter *iter,
gpointer user_data);
static gboolean accounts_dialog_flash_connecting_cb (EmpathyAccountsDialog *dialog);
-static gboolean accounts_dialog_are_accounts_connecting (MissionControl *mc);
static void accounts_dialog_connection_changed_cb (EmpathyAccountManager *manager,
McAccount *account,
TpConnectionStatusReason reason,
@@ -315,7 +314,7 @@ accounts_dialog_name_edited_cb (GtkCellRendererText *renderer,
GtkTreePath *treepath;
GtkTreeIter iter;
- if (accounts_dialog_are_accounts_connecting (dialog->mc)) {
+ if (empathy_account_manager_get_connecting_accounts (dialog->account_manager) > 0) {
dialog->connecting_id = g_timeout_add (FLASH_TIMEOUT,
(GSourceFunc) accounts_dialog_flash_connecting_cb,
dialog);
@@ -718,30 +717,6 @@ accounts_dialog_flash_connecting_cb (EmpathyAccountsDialog *dialog)
return TRUE;
}
-static gboolean
-accounts_dialog_are_accounts_connecting (MissionControl *mc)
-{
- GList *accounts, *l;
- gboolean found = FALSE;
-
- /* Check if there is still accounts in CONNECTING state */
- accounts = mc_accounts_list_by_enabled (TRUE);
- for (l = accounts; l; l = l->next) {
- McAccount *this_account = l->data;
- TpConnectionStatus status;
-
- status = mission_control_get_connection_status (mc, this_account,
- NULL);
- if (status == TP_CONNECTION_STATUS_CONNECTING) {
- found = TRUE;
- break;
- }
- }
- mc_accounts_list_free (accounts);
-
- return found;
-}
-
static void
accounts_dialog_connection_changed_cb (EmpathyAccountManager *manager,
McAccount *account,
@@ -769,12 +744,13 @@ accounts_dialog_connection_changed_cb (EmpathyAccountManager *manager,
gtk_tree_path_free (path);
}
- found = accounts_dialog_are_accounts_connecting (dialog->mc);
+ found = (empathy_account_manager_get_connecting_accounts (manager) > 0);
if (!found && dialog->connecting_id) {
g_source_remove (dialog->connecting_id);
dialog->connecting_id = 0;
}
+
if (found && !dialog->connecting_id) {
dialog->connecting_id = g_timeout_add (FLASH_TIMEOUT,
(GSourceFunc) accounts_dialog_flash_connecting_cb,