changeset 6088:4314e6be74c4

[gaim-migrate @ 6547] Fix removing groups containing chats, thanks to javabsp. Make sound prefs with empty file names show up as "(default)" rather than an empty input box. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 11 Jul 2003 05:10:56 +0000
parents 6e24de5efdb2
children 97835d03f0bb
files src/dialogs.c src/gtkprefs.c
diffstat 2 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Fri Jul 11 04:38:40 2003 +0000
+++ b/src/dialogs.c	Fri Jul 11 05:10:56 2003 +0000
@@ -424,13 +424,18 @@
 		if(GAIM_BLIST_NODE_IS_BUDDY(b)) {
 			struct buddy *bd = (struct buddy *)b;
 			GaimConversation *c = gaim_find_conversation(bd->name);
-			if(bd->account->gc) {
+			if (gaim_account_is_connected(bd->account)) {
 				serv_remove_buddy(bd->account->gc, bd->name, g->name);
 				gaim_blist_remove_buddy(bd);
 
 				if (c != NULL)
 					gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE);
 			}
+		} else if(GAIM_BLIST_NODE_IS_CHAT(b)) {
+			struct chat *chat = (struct chat *)b;
+			if (gaim_account_is_connected(chat->account)) {
+				gaim_blist_remove_chat(chat);
+			}
 		}
 		b = b->next;
 	}
--- a/src/gtkprefs.c	Fri Jul 11 04:38:40 2003 +0000
+++ b/src/gtkprefs.c	Fri Jul 11 05:10:56 2003 +0000
@@ -2003,7 +2003,7 @@
 	file = gaim_prefs_get_string(pref);
 	g_free(pref);
 	if (sound_entry)
-		gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)");
+		gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)");
 	g_value_unset (&val);
 	if (sounddialog)
 		gtk_widget_destroy(sounddialog);
@@ -2090,7 +2090,7 @@
 			gaim_gtk_sound_get_event_option(0));
 	file = gaim_prefs_get_string(pref);
 	g_free(pref);
-	gtk_entry_set_text(GTK_ENTRY(sound_entry), file ? file : "(default)");
+	gtk_entry_set_text(GTK_ENTRY(sound_entry), (file && *file != '\0') ? file : "(default)");
 	gtk_editable_set_editable(GTK_EDITABLE(sound_entry), FALSE);
 	gtk_box_pack_start(GTK_BOX(hbox), sound_entry, FALSE, FALSE, 5);