diff options
author | Not Zed <NotZed@Ximian.com> | 2002-09-18 12:14:56 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-09-18 12:14:56 +0800 |
commit | 17622eb8851214def3c21dff5abb375c5822b9a1 (patch) | |
tree | 27740fcaa4f5e4e972fb9817610b5647e35d850a /mail | |
parent | 9b16cf644368cb3f73bcb3ace71e8f66fdb84cbb (diff) | |
download | gsoc2013-evolution-17622eb8851214def3c21dff5abb375c5822b9a1.tar gsoc2013-evolution-17622eb8851214def3c21dff5abb375c5822b9a1.tar.gz gsoc2013-evolution-17622eb8851214def3c21dff5abb375c5822b9a1.tar.bz2 gsoc2013-evolution-17622eb8851214def3c21dff5abb375c5822b9a1.tar.lz gsoc2013-evolution-17622eb8851214def3c21dff5abb375c5822b9a1.tar.xz gsoc2013-evolution-17622eb8851214def3c21dff5abb375c5822b9a1.tar.zst gsoc2013-evolution-17622eb8851214def3c21dff5abb375c5822b9a1.zip |
helper to map a camel excpeiton to a listener result.
2002-09-18 Not Zed <NotZed@Ximian.com>
* component-factory.c (notify_listener_exception): helper to map a
camel excpeiton to a listener result.
(storage_create_folder): Use above to return more meaningful error.
(storage_remove_folder): "
(storage_xfer_folder): ". For #28209.
svn path=/trunk/; revision=18101
Diffstat (limited to 'mail')
-rw-r--r-- | mail/ChangeLog | 8 | ||||
-rw-r--r-- | mail/component-factory.c | 37 |
2 files changed, 36 insertions, 9 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 03127fd54f..4cc9afca4a 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2002-09-18 Not Zed <NotZed@Ximian.com> + + * component-factory.c (notify_listener_exception): helper to map a + camel excpeiton to a listener result. + (storage_create_folder): Use above to return more meaningful error. + (storage_remove_folder): " + (storage_xfer_folder): ". For #28209. + 2002-09-17 Jeffrey Stedfast <fejj@ximian.com> * mail-display.c (mail_display_render): Use e_strftime_fix_am_pm diff --git a/mail/component-factory.c b/mail/component-factory.c index a7aa0fa8a4..ca18001533 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -1100,6 +1100,30 @@ notify_listener (const Bonobo_Listener listener, } static void +notify_listener_exception(const Bonobo_Listener listener, CamelException *ex) +{ + GNOME_Evolution_Storage_Result result; + + switch(camel_exception_get_id(ex)) { + case CAMEL_EXCEPTION_SERVICE_UNAVAILABLE: + result = GNOME_Evolution_Storage_NOT_ONLINE; + break; + case CAMEL_EXCEPTION_NONE: + result = GNOME_Evolution_Storage_OK; + break; + case CAMEL_EXCEPTION_FOLDER_INVALID_PATH: + case CAMEL_EXCEPTION_SERVICE_URL_INVALID: + result = GNOME_Evolution_Storage_INVALID_URI; + break; + default: + result = GNOME_Evolution_Storage_GENERIC_ERROR; + break; + } + + notify_listener(listener, result); +} + +static void storage_create_folder (EvolutionStorage *storage, const Bonobo_Listener listener, const char *path, @@ -1142,9 +1166,8 @@ storage_create_folder (EvolutionStorage *storage, root = camel_store_create_folder (store, NULL, name, &ex); if (camel_exception_is_set (&ex)) { - /* FIXME: do better than this */ + notify_listener_exception(listener, &ex); camel_exception_clear (&ex); - notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); return; } @@ -1234,11 +1257,10 @@ storage_remove_folder (EvolutionStorage *storage, notify_listener (listener, GNOME_Evolution_Storage_OK); return; - exception: - /* FIXME: do better than this... */ +exception: + notify_listener_exception(listener, &ex); camel_exception_clear (&ex); camel_store_free_folder_info (store, root); - notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); } static void @@ -1265,10 +1287,7 @@ storage_xfer_folder (EvolutionStorage *storage, if (remove_source) { d(printf("trying to rename\n")); camel_store_rename_folder(store, src, dst, &ex); - if (camel_exception_is_set(&ex)) - notify_listener (listener, GNOME_Evolution_Storage_GENERIC_ERROR); - else - notify_listener (listener, GNOME_Evolution_Storage_OK); + notify_listener_exception(listener, &ex); } else { d(printf("No remove, can't rename\n")); /* FIXME: Implement folder 'copy' for remote stores */ |