diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-07 00:48:42 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-07 00:48:42 +0800 |
commit | 7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09 (patch) | |
tree | 6d725dc43a6b29b0a110c460885b9915c8cfdcf3 /mail/mail-callbacks.c | |
parent | 2b450081f656a1fc7ab986ed1746c90003a9809e (diff) | |
download | gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.tar.gz gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.tar.zst gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.zip |
Yuck. Special case whether or not we want to expunge all the trash folders
2001-08-06 Jeffrey Stedfast <fejj@ximian.com>
* mail-callbacks.c (empty_trash): Yuck. Special case whether or
not we want to expunge all the trash folders syncronously or
asyncronously based on whether or not we are doing Empty-On-Exit
or emptying trash by user request respectively.
svn path=/trunk/; revision=11701
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r-- | mail/mail-callbacks.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index ccb9977bbc..e1bb896ba5 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -2019,9 +2019,13 @@ empty_trash (BonoboUIComponent *uih, void *user_data, const char *path) CamelProvider *provider; CamelFolder *vtrash; const GSList *accounts; - CamelException *ex; + CamelException ex; + gboolean async; - ex = camel_exception_new (); + /* the only time all three args are NULL is for empty-on-exit */ + async = !(uih == NULL && user_data == NULL && path == NULL); + + camel_exception_init (&ex); /* expunge all remote stores */ accounts = mail_config_get_accounts (); @@ -2030,27 +2034,38 @@ empty_trash (BonoboUIComponent *uih, void *user_data, const char *path) /* make sure this is a valid source */ if (account->source && account->source->url) { - provider = camel_session_get_provider (session, account->source->url, NULL); + provider = camel_session_get_provider (session, account->source->url, &ex); if (provider) { /* make sure this store is a remote store */ if (provider->flags & CAMEL_PROVIDER_IS_STORAGE && provider->flags & CAMEL_PROVIDER_IS_REMOTE) { - vtrash = mail_tool_get_trash (account->source->url, NULL); + vtrash = mail_tool_get_trash (account->source->url, &ex); - if (vtrash) - mail_expunge_folder (vtrash, empty_trash_expunged_cb, NULL); + if (vtrash) { + if (async) + mail_expunge_folder (vtrash, empty_trash_expunged_cb, NULL); + else + camel_folder_sync (vtrash, TRUE, NULL); + } } } + + /* clear the exception for the next round */ + camel_exception_clear (&ex); } accounts = accounts->next; } /* Now empty the local trash folder */ - vtrash = mail_tool_get_trash ("file:/", ex); - if (vtrash) - mail_expunge_folder (vtrash, empty_trash_expunged_cb, NULL); + vtrash = mail_tool_get_trash ("file:/", &ex); + if (vtrash) { + if (async) + mail_expunge_folder (vtrash, empty_trash_expunged_cb, NULL); + else + camel_folder_sync (vtrash, TRUE, NULL); + } - camel_exception_free (ex); + camel_exception_clear (&ex); } static void |