changeset 22297:00c20312e289

Don't clear account errors during account-error-changed emission. I can't reproduce Stu's crash, but this fixes the error minidialog duplication I was seeing when trying to reproduce it, and I believe the cause is the same. References #4815
author Will Thompson <will.thompson@collabora.co.uk>
date Sat, 16 Feb 2008 14:42:57 +0000
parents 6d3f8042f21f
children 7c5734075af3
files pidgin/gtkblist.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Thu Feb 14 16:35:14 2008 +0000
+++ b/pidgin/gtkblist.c	Sat Feb 16 14:42:57 2008 +0000
@@ -4408,6 +4408,7 @@
 /***********************************/
 
 #define OBJECT_DATA_KEY_ACCOUNT "account"
+#define DO_NOT_CLEAR_ERROR "do-not-clear-error"
 
 static gboolean
 find_account_widget(GObject *widget,
@@ -4470,6 +4471,11 @@
 {
 	GtkWidget *widget = find_child_widget_by_account(container, account);
 	if(widget) {
+		/* Since we are destroying the widget in response to a change in
+		 * error, we should not clear the error.
+		 */
+		g_object_set_data(G_OBJECT(widget), DO_NOT_CLEAR_ERROR,
+			GINT_TO_POINTER(TRUE));
 		gtk_widget_destroy(widget);
 	}
 }
@@ -4495,7 +4501,12 @@
                          PurpleAccount *account)
 {
 	g_hash_table_remove(gtkblist->connection_errors, account);
-	purple_account_clear_current_error(account);
+	/* If the error dialog is being destroyed in response to the
+	 * account-error-changed signal, we don't want to clear the current
+	 * error.
+	 */
+	if (g_object_get_data(G_OBJECT(dialog), DO_NOT_CLEAR_ERROR) == NULL)
+		purple_account_clear_current_error(account);
 }
 
 #define SSL_FAQ_URI "http://d.pidgin.im/wiki/FAQssl"