From 889cbf11540c152be0e1c2d63758e5da8bd10a5f Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Thu, 29 Mar 2012 14:35:11 +0200 Subject: 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 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index b7b8aa39c..bab9dac29 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) { -- cgit v1.2.3