From ac97d963b038541b84aa15b4eaa3d28fd9d60114 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 23 Feb 2001 16:51:45 +0000 Subject: No longer need to do a vtrash_cleanup() (it also doesn't exist anymore). 2001-02-23 Jeffrey Stedfast * main.c (main): No longer need to do a vtrash_cleanup() (it also doesn't exist anymore). * component-factory.c (mail_load_storages): Updated to use the new vtrash code. (owner_set_cb): Same. * mail-tools.c (mail_tool_uri_to_folder): Update to handle the "vtrash:" url prefix so that we can extract the REAL uri and know to get the trash folder. * mail-vtrash.c (mail_vtrash_add): Add the vTrash folder to the EvolutionStorage. (mail_vtrash_create): Get the store based on the uri (async) and then call mail_trash_add. (vtrash_cleanup): Removed. (vtrash_uri_to_folder): Removed. (vtrash_create): Replaced by mail_vtrash_create() svn path=/trunk/; revision=8367 --- mail/mail-tools.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'mail/mail-tools.c') diff --git a/mail/mail-tools.c b/mail/mail-tools.c index ba457bd4cd..dcffb8ce50 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -31,7 +31,6 @@ #include "camel/camel.h" #include "camel/camel-vee-folder.h" #include "mail-vfolder.h" -#include "mail-vtrash.h" #include "filter/vfolder-rule.h" #include "filter/vfolder-context.h" #include "filter/filter-option.h" @@ -171,7 +170,6 @@ mail_tool_get_inbox (const gchar *url, CamelException *ex) return folder; } - /* why is this function so stupidly complex when allthe work is done elsehwere? */ char * @@ -308,33 +306,34 @@ mail_tool_uri_to_folder (const char *uri, CamelException *ex) CamelURL *url; CamelStore *store = NULL; CamelFolder *folder = NULL; + int offset = 0; g_return_val_if_fail (uri != NULL, NULL); - /* FIXME: This is a hack. */ - if (!strncmp (uri, "vtrash:", 7)) { - folder = vtrash_uri_to_folder (uri, ex); - if (folder) - return folder; - } + if (!strncmp (uri, "vtrash:", 7)) + offset = 7; - url = camel_url_new (uri, ex); + url = camel_url_new (uri + offset, ex); if (!url) return NULL; if (!strcmp (url->protocol, "vfolder")) { folder = vfolder_uri_to_folder (uri, ex); } else { - store = camel_session_get_store (session, uri, ex); + store = camel_session_get_store (session, uri + offset, ex); if (store) { char *name; - + if (url->path && *url->path) name = url->path + 1; else name = ""; - folder = camel_store_get_folder ( - store, name, CAMEL_STORE_FOLDER_CREATE, ex); + + if (offset) + folder = camel_store_get_trash (store, ex); + else + folder = camel_store_get_folder (store, name, + CAMEL_STORE_FOLDER_CREATE, ex); } } -- cgit