aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-02-24 00:51:45 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-02-24 00:51:45 +0800
commitac97d963b038541b84aa15b4eaa3d28fd9d60114 (patch)
treebd75dd9084c6315c49f094e5989ba5741f16e7ef /mail/mail-tools.c
parentc06709a5751b39e4a9cbf931759245f6abaa3d53 (diff)
downloadgsoc2013-evolution-ac97d963b038541b84aa15b4eaa3d28fd9d60114.tar.gz
gsoc2013-evolution-ac97d963b038541b84aa15b4eaa3d28fd9d60114.tar.zst
gsoc2013-evolution-ac97d963b038541b84aa15b4eaa3d28fd9d60114.zip
No longer need to do a vtrash_cleanup() (it also doesn't exist anymore).
2001-02-23 Jeffrey Stedfast <fejj@ximian.com> * 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
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c25
1 files changed, 12 insertions, 13 deletions
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);
}
}