From c413bd3b56597b5635d861a30727109e773d8176 Mon Sep 17 00:00:00 2001 From: 4 Date: Thu, 4 Oct 2001 19:19:26 +0000 Subject: Do the url fragment/path -> folder name hack. Removing vfolders from shell 2001-10-04 * component-factory.c (storage_remove_folder): Do the url fragment/path -> folder name hack. Removing vfolders from shell works now? svn path=/trunk/; revision=13416 --- mail/component-factory.c | 38 +++++++++++--------------------------- 1 file changed, 11 insertions(+), 27 deletions(-) (limited to 'mail/component-factory.c') diff --git a/mail/component-factory.c b/mail/component-factory.c index bec7eb70c5..74fac2b39f 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -944,11 +944,9 @@ storage_remove_folder (EvolutionStorage *storage, { CamelStore *store = user_data; CamelURL *url = NULL; - /*CamelFolderInfo *fi;*/ + char *name; CamelException ex; - /* FIXME: Jeff does this look right? */ - g_warning ("storage_remove_folder: path=\"%s\"; uri=\"%s\"", path, physical_uri); if (!path || !physical_uri || !strncmp (physical_uri, "vtrash:", 7)) { @@ -969,32 +967,23 @@ storage_remove_folder (EvolutionStorage *storage, } camel_exception_init (&ex); -#if 0 - fi = camel_store_get_folder_info (store, url->path + 1, - CAMEL_STORE_FOLDER_INFO_FAST, &ex); - camel_url_free (url); - if (camel_exception_is_set (&ex)) - goto exception; - - if (camel_store_supports_subscriptions (store)) - camel_store_unsubscribe_folder (store, fi->full_name, NULL); - - camel_store_delete_folder (store, fi->full_name, &ex); - - camel_store_free_folder_info (store, fi); -#else - + + if (url->fragment) + name = url->fragment; + else if (url->path && url->path[0]) + name = url->path+1; + else + name = ""; + if (camel_store_supports_subscriptions (store)) - camel_store_unsubscribe_folder (store, url->path + 1, NULL); + camel_store_unsubscribe_folder (store, name, NULL); - camel_store_delete_folder (store, url->path + 1, &ex); + camel_store_delete_folder (store, name, &ex); camel_url_free (url); if (camel_exception_is_set (&ex)) goto exception; -#endif - evolution_storage_removed_folder (storage, path); notify_listener (listener, GNOME_Evolution_Storage_OK); @@ -1003,11 +992,6 @@ storage_remove_folder (EvolutionStorage *storage, exception: /* FIXME: do better than this... */ camel_exception_clear (&ex); -#if 0 - if (fi) - camel_store_free_folder_info (store, fi); -#endif - notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); } -- cgit v1.2.3