From 8be7f276a292ba85e6bec20fd7d5a351f094296e Mon Sep 17 00:00:00 2001 From: 2 Date: Wed, 12 Sep 2001 21:50:00 +0000 Subject: Fixed the remove callback prototype, and return the result properly using 2001-09-12 * mail-vfolder.c (vfolder_remove_cb): Fixed the remove callback prototype, and return the result properly using the listener. svn path=/trunk/; revision=12786 --- mail/mail-vfolder.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'mail/mail-vfolder.c') diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index 6b141802e3..84523a1b69 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -253,14 +253,32 @@ unlist_vfolder (CamelObject *folder, gpointer event_data, gpointer user_data) g_message ("Whoa, unlisting vfolder %p but can't find it", folder); } -static int +static void vfolder_remove_cb (EvolutionStorage *storage, + const Bonobo_Listener listener, const char *path, const char *physical_uri, gpointer user_data) { - vfolder_remove (physical_uri); - return EVOLUTION_STORAGE_OK; + CORBA_any any; + CORBA_Environment ev; + GNOME_Evolution_Storage_Result corba_result = GNOME_Evolution_Storage_OK; + + if (strncmp(physical_uri, "vfolder:", 8) != 0) + corba_result = GNOME_Evolution_Storage_UNSUPPORTED_TYPE; + else if (vfolder_find(physical_uri + 8) == NULL) + corba_result = GNOME_Evolution_Storage_INVALID_URI; + else + vfolder_remove (physical_uri); + + 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); } void -- cgit