diff options
author | Chris Toshok <toshok@ximian.com> | 2001-10-13 06:28:04 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-10-13 06:28:04 +0800 |
commit | c90ced3180e92eaa690eef03b9b709f16030fa0c (patch) | |
tree | 7d53442b4c6523570946482526844aa95e22670e /mail/mail-config.c | |
parent | 47d5ddd05759815a8a11d4083298e1b81bf02163 (diff) | |
download | gsoc2013-evolution-c90ced3180e92eaa690eef03b9b709f16030fa0c.tar.gz gsoc2013-evolution-c90ced3180e92eaa690eef03b9b709f16030fa0c.tar.zst gsoc2013-evolution-c90ced3180e92eaa690eef03b9b709f16030fa0c.zip |
call e_passwords_init and e_passwords_shutdown.
2001-10-12 Chris Toshok <toshok@ximian.com>
* main.c (main): call e_passwords_init and e_passwords_shutdown.
* mail-session.h: add prototypes for
mail_session_{get,add}_password.
* mail-session.c (init): empty this out - we use e_passwords
instead of a local hashtable.
(get_password): use e_passwords_get_password and
e_passwords_add_password.
(forget_password): use e_passwords_forget_password.
(mail_session_remember_password): use
e_passwords_remember_password.
(mail_session_forget_password): use e_passwords_forget_password.
(mail_session_get_password): new function, use
e_passwords_get_password.
(mail_session_add_password): same, use e_passwords_add_password.
(mail_session_forget_passwords): use e_passwords_forget_passwords.
* mail-config.c (mail_config_write_on_exit): fix this up so it
works as desired with the e_passwords stuff.
svn path=/trunk/; revision=13640
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index 5ed4886163..9e66eea531 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -50,6 +50,7 @@ #include <e-util/e-html-utils.h> #include <e-util/e-url.h> #include <e-util/e-unicode-i18n.h> +#include <e-util/e-passwords.h> #include "mail.h" #include "mail-config.h" #include "mail-mt.h" @@ -886,19 +887,42 @@ mail_config_write_on_exit (void) CORBA_exception_free (&ev); /* Passwords */ - /* fixme: still depends on gnome-config */ - gnome_config_private_clean_section ("/Evolution/Passwords"); + + /* then we make sure the ones we want to remember are in the + session cache */ + accounts = mail_config_get_accounts (); + for ( ; accounts; accounts = accounts->next) { + char *passwd; + account = accounts->data; + if (account->source->save_passwd && account->source->url) { + passwd = mail_session_get_password (account->source->url); + mail_session_forget_password (account->source->url); + mail_session_add_password (account->source->url, passwd); + g_free (passwd); + } + + if (account->transport->save_passwd && account->transport->url) { + passwd = mail_session_get_password (account->transport->url); + mail_session_forget_password (account->transport->url); + mail_session_add_password (account->transport->url, passwd); + g_free (passwd); + } + } + + /* then we clear out our component passwords */ + e_passwords_clear_component_passwords (); + + /* then we remember them */ accounts = mail_config_get_accounts (); for ( ; accounts; accounts = accounts->next) { account = accounts->data; if (account->source->save_passwd && account->source->url) mail_session_remember_password (account->source->url); - + if (account->transport->save_passwd && account->transport->url) mail_session_remember_password (account->transport->url); } - gnome_config_sync (); - + /* now do cleanup */ mail_config_clear (); } |