[empathy] update infobar only on selected account



commit ca5fc936fb56cb00ebb436872697585d46d2c0df
Author: Felix Kaser <f kaser gmx net>
Date:   Thu Dec 10 00:28:34 2009 +0100

    update infobar only on selected account
    
    previously the infobar contained wrong statuses sometimes, if the auto reconnect on a faulty account triggered the update

 src/empathy-accounts-dialog.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 97ec23b..1040d70 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -184,6 +184,26 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
   guint                     reason;
   guint                     presence;
   EmpathyConnectivity       *connectivity;
+  GtkTreeView               *view;
+  GtkTreeModel              *model;
+  GtkTreeSelection          *selection;
+  GtkTreeIter               iter;
+  TpAccount                 *selected_account;
+
+  view = GTK_TREE_VIEW (priv->treeview);
+  selection = gtk_tree_view_get_selection (view);
+
+  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+    return;
+
+  gtk_tree_model_get (model, &iter,
+      COL_ACCOUNT_POINTER, &selected_account, -1);
+
+  /* do not update the infobar when the account is not selected */
+  if (account != selected_account)
+    {
+      return;
+    }
 
   status = tp_account_get_connection_status (account, &reason);
   presence = tp_account_get_current_presence (account, NULL, &status_message);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]