[empathy: 6/12] Simplified the code that checks if selected account has pending changes



commit 9b845e9ce1fe88006335f73a02ff68853757bd30
Author: Jonathan Tellier <jonathan tellier gmail com>
Date:   Fri Aug 28 11:06:14 2009 -0400

    Simplified the code that checks if selected account has pending changes

 src/empathy-accounts-dialog.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 807c78b..6cfc830 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -342,22 +342,18 @@ accounts_dialog_has_pending_change (EmpathyAccountsDialog *dialog,
   gboolean has_pending_changes;
   GtkTreeIter iter;
   GtkTreeModel *model;
-  EmpathyAccountSettings *settings;
+  GtkTreeSelection *selection;
   EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog);
 
-  model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview));
-  settings = accounts_dialog_model_get_selected_settings (dialog);
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview));
 
-  if (accounts_dialog_get_settings_iter (dialog, settings, &iter))
+  if (gtk_tree_selection_get_selected (selection, &model, &iter))
     gtk_tree_model_get (model, &iter, COL_ACCOUNT_POINTER, account, -1);
 
   has_pending_changes = account != NULL && priv->setting_widget_object != NULL
       && empathy_account_widget_contains_pending_changes (
           priv->setting_widget_object);
 
-  if (settings != NULL)
-    g_object_unref (settings);
-
   return has_pending_changes;
 }
 



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