changeset 9304:96c481da57ea

[gaim-migrate @ 10112] Protocol-specific settings for accounts were being removed whenever the account was modified. Now they're only removed when the protocol type changes, as it should be. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 18 Jun 2004 04:33:28 +0000
parents fe931c791fc0
children 0c201a2386c7
files ChangeLog src/account.h src/gtkaccount.c
diffstat 3 files changed, 19 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 17 01:34:58 2004 +0000
+++ b/ChangeLog	Fri Jun 18 04:33:28 2004 +0000
@@ -36,6 +36,9 @@
 	* The disconnected UI op was called twice on connection errors. Now
 	  it is only called once. (Evan Schoenberg)
 	* Dragging into conversation windows works better
+	* Protocol-specific settings for accounts were being removed whenever the
+	  account was modified. Now they're only removed when the protocol type
+	  changes, as it should be.
 
 version 0.78 (05/30/2004):
 	New Features:
--- a/src/account.h	Thu Jun 17 01:34:58 2004 +0000
+++ b/src/account.h	Fri Jun 18 04:33:28 2004 +0000
@@ -72,7 +72,7 @@
 	GSList *deny;               /**< Deny list.                           */
 	int perm_deny;              /**< The permit/deny setting.             */
 	GaimLog *system_log;        /**< The system log                       */
-	
+
 	void *ui_data;             /**< The UI can put data here.			  */
 };
 
@@ -541,7 +541,7 @@
  *
  * @param account The account.
  */
-	void gaim_account_destroy_log(GaimAccount *account);
+void gaim_account_destroy_log(GaimAccount *account);
 
 /*@}*/
 
--- a/src/gtkaccount.c	Thu Jun 17 01:34:58 2004 +0000
+++ b/src/gtkaccount.c	Fri Jun 18 04:33:28 2004 +0000
@@ -201,7 +201,17 @@
 set_account_protocol_cb(GtkWidget *item, const char *id,
 						AccountPrefsDialog *dialog)
 {
-	if ((dialog->plugin = gaim_find_prpl(id)) != NULL) {
+	GaimPlugin *new_plugin;
+
+	new_plugin = gaim_find_prpl(id);
+
+	if (new_plugin == dialog->plugin)
+		return;
+
+	dialog->plugin = new_plugin;
+
+	if (dialog->plugin != NULL)
+	{
 		dialog->prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(dialog->plugin);
 
 		if (dialog->protocol_id != NULL)
@@ -210,6 +220,9 @@
 		dialog->protocol_id = g_strdup(dialog->plugin->info->id);
 	}
 
+	if (dialog->account != NULL)
+		gaim_account_clear_settings(dialog->account);
+
 	add_login_options(dialog,    dialog->top_vbox);
 	add_user_options(dialog,     dialog->top_vbox);
 	add_protocol_options(dialog, dialog->bottom_vbox);
@@ -1077,9 +1090,6 @@
 		gaim_account_set_protocol_id(dialog->account, dialog->protocol_id);
 	}
 
-	/* Clear the existing settings. */
-	gaim_account_clear_settings(dialog->account);
-
 	/* Alias */
 	value = gtk_entry_get_text(GTK_ENTRY(dialog->alias_entry));