From 3ac3a15e3ccad3b7eb27f9f1db172effa951b554 Mon Sep 17 00:00:00 2001 From: 5 Date: Mon, 15 Oct 2001 18:55:18 +0000 Subject: Proxy get-password call to main thread. (forget_password): same for 2001-10-15 * mail-session.c (get_password): Proxy get-password call to main thread. (forget_password): same for forget_password. (get_filter_driver): and same for get_filter_driver, since it uses gtk objects. * mail-mt.c (mail_call_main): new generic interface for calling stuff/proxying in the gui thread. svn path=/trunk/; revision=13679 --- mail/mail-session.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) (limited to 'mail/mail-session.c') diff --git a/mail/mail-session.c b/mail/mail-session.c index 643f60fc42..bf8d5560c3 100644 --- a/mail/mail-session.c +++ b/mail/mail-session.c @@ -131,8 +131,8 @@ make_key (CamelService *service, const char *item) } static char * -get_password (CamelSession *session, const char *prompt, gboolean secret, - CamelService *service, const char *item, CamelException *ex) +main_get_password (CamelSession *session, const char *prompt, gboolean secret, + CamelService *service, const char *item, CamelException *ex) { MailSession *mail_session = MAIL_SESSION (session); gboolean cache = TRUE; @@ -173,9 +173,16 @@ get_password (CamelSession *session, const char *prompt, gboolean secret, return ans; } +static char * +get_password (CamelSession *session, const char *prompt, gboolean secret, + CamelService *service, const char *item, CamelException *ex) +{ + return (char *)mail_call_main(MAIL_CALL_p_ppippp, (MailMainFunc)main_get_password, + session, prompt, secret, service, item, ex); +} + static void -forget_password (CamelSession *session, CamelService *service, - const char *item, CamelException *ex) +main_forget_password (CamelSession *session, CamelService *service, const char *item, CamelException *ex) { char *key = make_key (service, item); @@ -184,6 +191,13 @@ forget_password (CamelSession *session, CamelService *service, g_free (key); } +static void +forget_password (CamelSession *session, CamelService *service, const char *item, CamelException *ex) +{ + mail_call_main(MAIL_CALL_p_pppp, (MailMainFunc)main_forget_password, + session, service, item, ex); +} + static gboolean alert_user (CamelSession *session, CamelSessionAlertType type, const char *prompt, gboolean cancel) @@ -317,7 +331,7 @@ get_folder (CamelFilterDriver *d, const char *uri, void *data, CamelException *e } static CamelFilterDriver * -get_filter_driver (CamelSession *session, const char *type, CamelException *ex) +main_get_filter_driver (CamelSession *session, const char *type, CamelException *ex) { CamelFilterDriver *driver; RuleContext *fc; @@ -369,6 +383,13 @@ get_filter_driver (CamelSession *session, const char *type, CamelException *ex) return driver; } +static CamelFilterDriver * +get_filter_driver (CamelSession *session, const char *type, CamelException *ex) +{ + return (CamelFilterDriver *)mail_call_main(MAIL_CALL_p_ppp, (MailMainFunc)main_get_filter_driver, + session, type, ex); +} + char * mail_session_get_password (const char *url_string) { -- cgit