[empathy] accounts-dialog: use gtk_list_store_insert_with_values()



commit 889cbf11540c152be0e1c2d63758e5da8bd10a5f
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Mar 29 14:35:11 2012 +0200

    accounts-dialog: use gtk_list_store_insert_with_values()
    
    Prevent a crash when using a11y as GTK+ may want to look at the content of the
    row as soon it's added. See the bug for details.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=670601

 src/empathy-accounts-dialog.c |   21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index b7b8aa3..bab9dac 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -1974,19 +1974,24 @@ accounts_dialog_add_account (EmpathyAccountsDialog *dialog,
       if (gtk_tree_selection_count_selected_rows (selection) == 0)
         selected = TRUE;
 
-      gtk_list_store_append (GTK_LIST_STORE (model), &iter);
+      gtk_list_store_insert_with_values (GTK_LIST_STORE (model), &iter, -1,
+          COL_NAME, name,
+          COL_STATUS, status,
+          COL_ACCOUNT, account,
+          COL_ACCOUNT_SETTINGS, settings,
+          -1);
     }
   else
     {
       selected = gtk_tree_selection_iter_is_selected (selection, &iter);
-    }
 
-  gtk_list_store_set (GTK_LIST_STORE (model), &iter,
-      COL_NAME, name,
-      COL_STATUS, status,
-      COL_ACCOUNT, account,
-      COL_ACCOUNT_SETTINGS, settings,
-      -1);
+      gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+          COL_NAME, name,
+          COL_STATUS, status,
+          COL_ACCOUNT, account,
+          COL_ACCOUNT_SETTINGS, settings,
+          -1);
+    }
 
   if (selected)
     {



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