Mercurial > pidgin
changeset 18655:a5f441181e48
merge of '391beabbbe9b94205d5c2d9ef073ecff207da387'
and 'f6f1c9124604cf2319e9f3c8dfa85a1badb5db68'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Fri, 27 Jul 2007 10:44:24 +0000 |
parents | 24e3cca6b03c (current diff) 05cab350d1fb (diff) |
children | 2848d536ac7e |
files | |
diffstat | 2 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkblist.c Wed Jul 25 21:42:15 2007 +0000 +++ b/pidgin/gtkblist.c Fri Jul 27 10:44: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 Wed Jul 25 21:42:15 2007 +0000 +++ b/pidgin/gtkconv.c Fri Jul 27 10:44:24 2007 +0000 @@ -2975,7 +2975,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); } @@ -2993,6 +2993,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); } @@ -3373,7 +3377,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;