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 | |
parent | 2b450081f656a1fc7ab986ed1746c90003a9809e (diff) | |
download | gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.tar gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.tar.gz gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.tar.bz2 gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.tar.lz gsoc2013-evolution-7ebb69efa28ff4274bf1f0b3aeba8d271c6c1d09.tar.xz 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')
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/component-factory.c | 2 | ||||
-rw-r--r-- | mail/mail-callbacks.c | 35 |
3 files changed, 33 insertions, 11 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index c502ff40f9..96af73c18a 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +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. + 2001-08-06 Jason Leach <jleach@ximian.com> * mail-folder-cache.c (make_folder_name): Removed this function, diff --git a/mail/component-factory.c b/mail/component-factory.c index 4c947c1fa1..4275079894 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -682,7 +682,7 @@ static void debug_cb (EvolutionShellComponent *shell_component, gpointer user_data) { extern gboolean camel_verbose_debug; - + camel_verbose_debug = 1; } 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 |