aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-03-13 04:31:56 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-03-13 04:31:56 +0800
commit1b9b476eac2173203e4b383883a3721662ab8f44 (patch)
treef49cd971d239f575d214e7eea0d8268c2d3445e6 /mail/mail-ops.c
parent56d1340c361655d699f5a51f7187b9aff2dde3f2 (diff)
downloadgsoc2013-evolution-1b9b476eac2173203e4b383883a3721662ab8f44.tar
gsoc2013-evolution-1b9b476eac2173203e4b383883a3721662ab8f44.tar.gz
gsoc2013-evolution-1b9b476eac2173203e4b383883a3721662ab8f44.tar.bz2
gsoc2013-evolution-1b9b476eac2173203e4b383883a3721662ab8f44.tar.lz
gsoc2013-evolution-1b9b476eac2173203e4b383883a3721662ab8f44.tar.xz
gsoc2013-evolution-1b9b476eac2173203e4b383883a3721662ab8f44.tar.zst
gsoc2013-evolution-1b9b476eac2173203e4b383883a3721662ab8f44.zip
Instead of always creating a new vTrash folder, if the store already has a
2001-03-12 Jeffrey Stedfast <fejj@ximian.com> * mail-ops.c (add_vtrash_info): Instead of always creating a new vTrash folder, if the store already has a Trash folder, replace it with the vTrash. Also, name the folder "Trash" instead of "vTrash" and i18nify the name. svn path=/trunk/; revision=8644
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 49f39e6b0b..11ec9d3ab9 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -936,28 +936,39 @@ add_vtrash_info (CamelFolderInfo *info)
CamelURL *url;
char *uri;
+ g_return_if_fail (info != NULL);
+
for (fi = info; fi->sibling; fi = fi->sibling) {
- if (!strcmp (fi->name, "vTrash"))
- return;
+ if (!strcmp (fi->name, _("Trash")))
+ break;
}
/* create our vTrash URL */
url = camel_url_new (info->url, NULL);
g_free (url->path);
- url->path = g_strdup ("vTrash");
+ url->path = g_strdup (_("Trash"));
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");
+ if (fi->sibling) {
+ /* We're going to replace the physical Trash folder with our vTrash folder */
+ vtrash = fi;
+ g_free (vtrash->full_name);
+ g_free (vtrash->name);
+ g_free (vtrash->url);
+ } else {
+ /* There wasn't a Trash folder so create a new folder entry */
+ vtrash = g_new0 (CamelFolderInfo, 1);
+ vtrash->parent = fi;
+ fi->sibling = vtrash;
+ }
+
+ /* Fill in the new fields */
+ vtrash->full_name = g_strdup (_("Trash"));
+ vtrash->name = g_strdup (_("Trash"));
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)