Mercurial > pidgin.yaz
changeset 18656:2848d536ac7e
merge of '004a538ba55a170d9662546cda8d93eb7d64507b'
and '0a09dfc15a18e5e6eb535ecef8289b9a2ecb2fbd'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 27 Jul 2007 10:48:24 +0000 |
parents | 2ec7abcedf47 (current diff) a5f441181e48 (diff) |
children | 46629aab70b1 1987beefd494 |
files | pidgin/gtkconv.c |
diffstat | 2 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Fri Jul 27 08:24:11 2007 +0000 +++ b/pidgin/gtkblist.c Fri Jul 27 10:48:24 2007 +0000 @@ -629,8 +629,7 @@ gc = purple_account_get_connection(data->account); - while ((tmp = gtk_container_get_children(GTK_CONTAINER(data->entries_box)))) - gtk_widget_destroy(tmp->data); + gtk_container_foreach(GTK_CONTAINER(data->entries_box), (GtkCallback)gtk_widget_destroy, NULL); g_list_free(data->entries); data->entries = NULL; @@ -4000,6 +3999,7 @@ char *primary; const char *text; gboolean enabled; + GList *list; account = user_data; primary = g_strdup_printf(_("%s disconnected"), @@ -4018,8 +4018,10 @@ g_free(primary); gtk_widget_destroy(GTK_WIDGET(widget)); g_hash_table_remove(gtkblist->connection_errors, account); - if (gtk_container_get_children(GTK_CONTAINER(gtkblist->error_buttons)) == NULL) { + if ((list = gtk_container_get_children(GTK_CONTAINER(gtkblist->error_buttons))) == NULL) { gtk_widget_hide(gtkblist->error_buttons); + } else { + g_list_free(list); } } @@ -4089,7 +4091,7 @@ /* Remove the old error buttons */ for (l = gtk_container_get_children(GTK_CONTAINER(gtkblist->error_buttons)); l != NULL; - l = l->next) + l = g_list_delete_link(l, l)) { gtk_widget_destroy(GTK_WIDGET(l->data)); } @@ -5648,8 +5650,7 @@ gc = purple_account_get_connection(data->account); - while ((tmp = gtk_container_get_children(GTK_CONTAINER(data->entries_box)))) - gtk_widget_destroy(tmp->data); + gtk_container_foreach(GTK_CONTAINER(data->entries_box), (GtkCallback)gtk_widget_destroy, NULL); g_list_free(data->entries); @@ -6526,7 +6527,7 @@ return; /* Clear the old Accounts menu */ - for (l = gtk_container_get_children(GTK_CONTAINER(accountmenu)); l; l = l->next) { + for (l = gtk_container_get_children(GTK_CONTAINER(accountmenu)); l; l = g_list_delete_link(l, l)) { menuitem = l->data; if (menuitem != gtk_item_factory_get_widget(gtkblist->ift, N_("/Accounts/Add\\/Edit"))) @@ -6737,7 +6738,7 @@ return; /* Clear the old menu */ - for (l = gtk_container_get_children(GTK_CONTAINER(sortmenu)); l; l = l->next) { + for (l = gtk_container_get_children(GTK_CONTAINER(sortmenu)); l; l = g_list_delete_link(l, l)) { menuitem = l->data; gtk_widget_destroy(GTK_WIDGET(menuitem)); }
--- a/pidgin/gtkconv.c Fri Jul 27 08:24:11 2007 +0000 +++ b/pidgin/gtkconv.c Fri Jul 27 10:48:24 2007 +0000 @@ -2977,7 +2977,7 @@ for (list = gtk_container_get_children(GTK_CONTAINER(menu)); list; ) { GtkWidget *w = list->data; - list = list->next; + list = g_list_delete_link(list, list); gtk_widget_destroy(w); } @@ -2995,6 +2995,10 @@ gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); gtk_widget_set_sensitive(item, FALSE); } + else + { + g_list_free(list); + } gtk_widget_show_all(menu); } @@ -3375,7 +3379,7 @@ for (child = gtk_container_get_children(GTK_CONTAINER(menu)); child != NULL; - child = child->next) { + child = g_list_delete_link(child, child)) { GtkWidget *item = child->data; PurpleBuddy *item_buddy;