pidgin: 752623f6: When switching the account in the Disco ...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Mon Oct 19 19:02:36 EDT 2009


-----------------------------------------------------------------
Revision: 752623f68962a90397d0ac88cfa20f7435e704aa
Ancestor: 42ef226b881103f4e4d31960abd46dd8cd60e179
Author: darkrain42 at pidgin.im
Date: 2009-10-19T22:56:27
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/752623f68962a90397d0ac88cfa20f7435e704aa

Modified files:
        pidgin/gtkroomlist.c pidgin/plugins/disco/gtkdisco.c

ChangeLog: 

When switching the account in the Disco / Room List dialogs, kill the visible
results, as the results are not at all guaranteed to be applicable to the
newly-selected account.

Among other things, this happens when you disconnect an account with the
Disco Browser or Room List dialogs open.

-------------- next part --------------
============================================================
--- pidgin/gtkroomlist.c	273d057f8497dbc7e6bdbab459cb5a0c968877f0
+++ pidgin/gtkroomlist.c	52f844d547cfcba5389d2631c9214115af499495
@@ -111,7 +111,18 @@ static void dialog_select_account_cb(GOb
 static void dialog_select_account_cb(GObject *w, PurpleAccount *account,
 				     PidginRoomlistDialog *dialog)
 {
+	gboolean change = (account != dialog->account);
 	dialog->account = account;
+
+	if (change && dialog->roomlist) {
+		PidginRoomlist *rl = dialog->roomlist->ui_data;
+		if (rl->tree) {
+			gtk_widget_destroy(rl->tree);
+			rl->tree = NULL;
+		}
+		purple_roomlist_unref(dialog->roomlist);
+		dialog->roomlist = NULL;
+	}
 }
 
 static void list_button_cb(GtkButton *button, PidginRoomlistDialog *dialog)
============================================================
--- pidgin/plugins/disco/gtkdisco.c	23da4de90b47c9c618ba024de80efd47166e3e5f
+++ pidgin/plugins/disco/gtkdisco.c	f548a94bcd8a21c5bc18ebc997e5d81998e60bf8
@@ -141,8 +141,18 @@ static void dialog_select_account_cb(GOb
 static void dialog_select_account_cb(GObject *w, PurpleAccount *account,
                                      PidginDiscoDialog *dialog)
 {
+	gboolean change = (account != dialog->account);
 	dialog->account = account;
 	gtk_widget_set_sensitive(dialog->browse_button, account != NULL);
+
+	if (change && dialog->discolist) {
+		if (dialog->discolist->tree) {
+			gtk_widget_destroy(dialog->discolist->tree);
+			dialog->discolist->tree = NULL;
+		}
+		pidgin_disco_list_unref(dialog->discolist);
+		dialog->discolist = NULL;
+	}
 }
 
 static void register_button_cb(GtkWidget *unused, PidginDiscoDialog *dialog)


More information about the Commits mailing list