aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-02-25 04:08:43 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-02-25 04:08:43 +0800
commit0ce50d4fdc52664c830b244ae875ff387cac4ecb (patch)
treea41680c533a1bf5e0e59f2668a1225fe6784acc2 /mail/mail-ops.c
parentbef47a636432fe5791649412cf1a936b2c2b186b (diff)
downloadgsoc2013-evolution-0ce50d4fdc52664c830b244ae875ff387cac4ecb.tar.gz
gsoc2013-evolution-0ce50d4fdc52664c830b244ae875ff387cac4ecb.tar.zst
gsoc2013-evolution-0ce50d4fdc52664c830b244ae875ff387cac4ecb.zip
No longer need to construct the vTrash here. (owner_set_cb): Don't make
2001-02-24 Jeffrey Stedfast <fejj@ximian.com> * component-factory.c (mail_load_storages): No longer need to construct the vTrash here. (owner_set_cb): Don't make the vTrash for the local store here. * mail-ops.c (add_vtrash_info): New function to add a vTrash folder info to a pre-constructed CamelFolderInfo for use in the get_folder_info async function. svn path=/trunk/; revision=8381
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 6a68cbd6be..947bba4a9d 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -924,12 +924,47 @@ static char *get_folderinfo_desc(struct _mail_msg *mm, int done)
return ret;
}
+static void
+add_vtrash_info (CamelFolderInfo *info)
+{
+ CamelFolderInfo *fi, *vtrash;
+ CamelURL *url;
+ char *uri;
+
+ if (!info)
+ return;
+
+ for (fi = info; fi->sibling; fi = fi->sibling) {
+ if (!strcmp (fi->name, "vTrash"))
+ return;
+ }
+
+ /* create our vTrash URL */
+ url = camel_url_new (info->url, NULL);
+ g_free (url->path);
+ url->path = g_strdup ("vTrash");
+ uri = camel_url_to_string (url, FALSE);
+ camel_url_free (url);
+
+ vtrash = g_new0 (CamelFolderInfo, 1);
+ vtrash->full_name = g_strdup ("vTrash");
+ vtrash->name = g_strdup ("vTrash");
+ vtrash->url = g_strdup_printf ("vtrash:%s", uri);
+ vtrash->unread_message_count = -1;
+ g_free (uri);
+
+ vtrash->parent = fi;
+
+ fi->sibling = vtrash;
+}
+
static void get_folderinfo_get(struct _mail_msg *mm)
{
struct _get_folderinfo_msg *m = (struct _get_folderinfo_msg *)mm;
-
+
camel_operation_register(mm->cancel);
m->info = camel_store_get_folder_info(m->store, NULL, FALSE, TRUE, TRUE, &mm->ex);
+ add_vtrash_info (m->info);
camel_operation_unregister(mm->cancel);
}