aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog7
-rw-r--r--mail/mail-ops.c31
2 files changed, 28 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b0a3bc8634..95b1c335b6 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2001-03-11 Jeffrey Stedfast <fejj@ximian.com>
* mail-ops.h: Added protection.
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)