From 2b1d1fdc36a85c3cd3b18cd1d24ef36e35d36504 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 9 Jan 2001 17:21:34 +0000 Subject: New function to set the password for a given url. 2001-01-09 Jeffrey Stedfast * session.c (mail_session_set_password): New function to set the password for a given url. * mail-config-druid.c (druid_finish): Don't save the password in the source url, instead insert it into the save-password hash. (mail_config_druid_get_source_url): Check to make sure the authmech isn't "", if it is then don't set the authmech. * mail-account-editor.c (apply_changes): Don't save the password in the source url, instead insert it into the save-password hash. Also check to make sure we don't set an empty string as the authmech for the source or transport. * mail-accounts.c (mail_default): After reloading the accounts, reselect the previously selected account. (mail_delete): Same. * mail-config-druid.c (druid_cancel): Fixed segfault bug. svn path=/trunk/; revision=7319 --- mail/mail-accounts.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'mail/mail-accounts.c') diff --git a/mail/mail-accounts.c b/mail/mail-accounts.c index 9d0fd7090c..f48e33120d 100644 --- a/mail/mail-accounts.c +++ b/mail/mail-accounts.c @@ -209,19 +209,20 @@ mail_delete (GtkButton *button, gpointer data) MailConfigAccount *account; if (dialog->accounts_row >= 0) { - int row, len; + int sel, row, len; - account = gtk_clist_get_row_data (dialog->mail_accounts, dialog->accounts_row); + sel = dialog->accounts_row; + + account = gtk_clist_get_row_data (dialog->mail_accounts, sel); g_slist_remove ((GSList *) dialog->accounts, account); account_destroy (account); mail_config_write (); - gtk_clist_remove (dialog->mail_accounts, dialog->accounts_row); + gtk_clist_remove (dialog->mail_accounts, sel); len = g_slist_length ((GSList *) dialog->accounts); if (len > 0) { - row = dialog->accounts_row; - row = row >= len ? len - 1 : row; + row = sel >= len ? len - 1 : sel; gtk_clist_select_row (dialog->mail_accounts, row, 0); } else { dialog->accounts_row = -1; @@ -239,10 +240,14 @@ mail_default (GtkButton *button, gpointer data) const MailConfigAccount *account; if (dialog->accounts_row >= 0) { - account = gtk_clist_get_row_data (dialog->mail_accounts, dialog->accounts_row); + int row; + + row = dialog->accounts_row; + account = gtk_clist_get_row_data (dialog->mail_accounts, row); mail_config_set_default_account (account); mail_config_write (); load_accounts (dialog); + gtk_clist_select_row (dialog->mail_accounts, row, 0); } } -- cgit v1.2.3