diff options
author | Chris Toshok <toshok@ximian.com> | 2001-09-07 14:47:18 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2001-09-07 14:47:18 +0800 |
commit | 5bfc4574079e56116429b223b844139b7a7f3a52 (patch) | |
tree | d99595ee70aad20757c94d7d3909f642d1680dbf | |
parent | da42183a7b7de1e9aef23f1d75f91f8935d01d7e (diff) | |
download | gsoc2013-evolution-5bfc4574079e56116429b223b844139b7a7f3a52.tar gsoc2013-evolution-5bfc4574079e56116429b223b844139b7a7f3a52.tar.gz gsoc2013-evolution-5bfc4574079e56116429b223b844139b7a7f3a52.tar.bz2 gsoc2013-evolution-5bfc4574079e56116429b223b844139b7a7f3a52.tar.lz gsoc2013-evolution-5bfc4574079e56116429b223b844139b7a7f3a52.tar.xz gsoc2013-evolution-5bfc4574079e56116429b223b844139b7a7f3a52.tar.zst gsoc2013-evolution-5bfc4574079e56116429b223b844139b7a7f3a52.zip |
new function, to notify the bonobo listener in
2001-09-06 Chris Toshok <toshok@ximian.com>
* component-factory.c (notify_listener): new function, to notify
the bonobo listener in remove_folder/create_folder.
(storage_create_folder): match EvolutionStorage create_folder
signal's signature.
(storage_remove_folder): match EvolutionStorage remove_folder
signal's signature.
svn path=/trunk/; revision=12671
-rw-r--r-- | mail/ChangeLog | 9 | ||||
-rw-r--r-- | mail/component-factory.c | 69 |
2 files changed, 60 insertions, 18 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 91c2f773d2..69a2a57317 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-09-06 Chris Toshok <toshok@ximian.com> + + * component-factory.c (notify_listener): new function, to notify + the bonobo listener in remove_folder/create_folder. + (storage_create_folder): match EvolutionStorage create_folder + signal's signature. + (storage_remove_folder): match EvolutionStorage remove_folder + signal's signature. + 2001-09-06 Dan Winship <danw@ximian.com> Fix a bunch of replying/forwarding-related formatting bugs. diff --git a/mail/component-factory.c b/mail/component-factory.c index 8dbf22fe1b..ea48357bdb 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -804,8 +804,26 @@ component_factory_init (void) evolution_folder_info_factory_init (); } -static int +static void +notify_listener (const Bonobo_Listener listener, + GNOME_Evolution_Storage_Result corba_result) +{ + CORBA_any any; + CORBA_Environment ev; + + CORBA_exception_init (&ev); + + any._type = TC_GNOME_Evolution_Storage_Result; + any._value = &corba_result; + + Bonobo_Listener_event (listener, "result", &any, &ev); + + CORBA_exception_free (&ev); +} + +static void storage_create_folder (EvolutionStorage *storage, + const Bonobo_Listener listener, const char *path, const char *type, const char *description, @@ -818,18 +836,24 @@ storage_create_folder (EvolutionStorage *storage, CamelURL *url; CamelException ex; - if (strcmp (type, "mail") != 0) - return EVOLUTION_STORAGE_ERROR_UNSUPPORTED_TYPE; + if (strcmp (type, "mail") != 0) { + notify_listener (listener, GNOME_Evolution_Storage_UNSUPPORTED_TYPE); + return; + } name = strrchr (path, '/'); - if (!name++) - return EVOLUTION_STORAGE_ERROR_INVALID_URI; + if (!name++) { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; + } camel_exception_init (&ex); if (*parent_physical_uri) { url = camel_url_new (parent_physical_uri, NULL); - if (!url) - return EVOLUTION_STORAGE_ERROR_INVALID_URI; + if (!url) { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; + } root = camel_store_create_folder (store, url->path + 1, name, &ex); camel_url_free (url); @@ -839,7 +863,8 @@ storage_create_folder (EvolutionStorage *storage, if (camel_exception_is_set (&ex)) { /* FIXME: do better than this */ camel_exception_clear (&ex); - return EVOLUTION_STORAGE_ERROR_INVALID_URI; + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; } if (camel_store_supports_subscriptions (store)) { @@ -853,11 +878,12 @@ storage_create_folder (EvolutionStorage *storage, camel_store_free_folder_info (store, root); - return EVOLUTION_STORAGE_OK; + notify_listener (listener, GNOME_Evolution_Storage_OK); } -static int +static void storage_remove_folder (EvolutionStorage *storage, + const Bonobo_Listener listener, const char *path, const char *physical_uri, gpointer user_data) @@ -870,15 +896,21 @@ storage_remove_folder (EvolutionStorage *storage, g_warning ("storage_remove_folder: path=\"%s\"; uri=\"%s\"", path, physical_uri); if (*physical_uri) { - if (strncmp (physical_uri, "vtrash:", 7) == 0) - return EVOLUTION_STORAGE_ERROR_INVALID_URI; + if (strncmp (physical_uri, "vtrash:", 7) == 0) { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; + } url = camel_url_new (physical_uri, NULL); - if (!url) - return EVOLUTION_STORAGE_ERROR_INVALID_URI; + if (!url) { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; + } } else { - if (!*path) - return EVOLUTION_STORAGE_ERROR_INVALID_URI; + if (!*path) { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); + return; + } } camel_exception_init (&ex); @@ -900,7 +932,8 @@ storage_remove_folder (EvolutionStorage *storage, camel_store_free_folder_info (store, fi); - return EVOLUTION_STORAGE_OK; + notify_listener (listener, GNOME_Evolution_Storage_OK); + return; exception: /* FIXME: do better than this... */ @@ -908,7 +941,7 @@ storage_remove_folder (EvolutionStorage *storage, if (fi) camel_store_free_folder_info (store, fi); - return EVOLUTION_STORAGE_ERROR_INVALID_URI; + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); } static void |