aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-02-27 14:08:04 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-02-27 14:08:04 +0800
commit9d7aa0250f1c60c254712132c43b9c24b58cab20 (patch)
treeee2a5b0fe39f32c15ea580569853dfffa94fb0a7 /camel
parenta25caa7969d1714e0f56f4f72cc981bf955f95eb (diff)
downloadgsoc2013-evolution-9d7aa0250f1c60c254712132c43b9c24b58cab20.tar
gsoc2013-evolution-9d7aa0250f1c60c254712132c43b9c24b58cab20.tar.gz
gsoc2013-evolution-9d7aa0250f1c60c254712132c43b9c24b58cab20.tar.bz2
gsoc2013-evolution-9d7aa0250f1c60c254712132c43b9c24b58cab20.tar.lz
gsoc2013-evolution-9d7aa0250f1c60c254712132c43b9c24b58cab20.tar.xz
gsoc2013-evolution-9d7aa0250f1c60c254712132c43b9c24b58cab20.tar.zst
gsoc2013-evolution-9d7aa0250f1c60c254712132c43b9c24b58cab20.zip
** See bug #54755.
2004-02-27 Not Zed <NotZed@Ximian.com> ** See bug #54755. * camel-vtrash-folder.c (vtrash_append_message) (vtrash_transfer_messages_to): error/fail out if the user tries to copy messages to the trash. (vtrash_transfer_messages_to): use the destination bit not the source bit for moving messages to a vtrash folder. svn path=/trunk/; revision=24906
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-vtrash-folder.c18
-rw-r--r--camel/camel-vtrash-folder.h1
2 files changed, 14 insertions, 5 deletions
diff --git a/camel/camel-vtrash-folder.c b/camel/camel-vtrash-folder.c
index cd5df81dc6..667b574646 100644
--- a/camel/camel-vtrash-folder.c
+++ b/camel/camel-vtrash-folder.c
@@ -38,9 +38,12 @@ static struct {
const char *expr;
guint32 bit;
guint32 flags;
+ const char *error_copy;
} vdata[] = {
- { CAMEL_VTRASH_NAME, "(match-all (system-flag \"Deleted\"))", CAMEL_MESSAGE_DELETED, CAMEL_FOLDER_IS_TRASH },
- { CAMEL_VJUNK_NAME, "(match-all (system-flag \"Junk\"))", CAMEL_MESSAGE_JUNK, CAMEL_FOLDER_IS_JUNK },
+ { CAMEL_VTRASH_NAME, "(match-all (system-flag \"Deleted\"))", CAMEL_MESSAGE_DELETED, CAMEL_FOLDER_IS_TRASH,
+ N_("Cannot copy messages to the Trash folder") },
+ { CAMEL_VJUNK_NAME, "(match-all (system-flag \"Junk\"))", CAMEL_MESSAGE_JUNK, CAMEL_FOLDER_IS_JUNK,
+ N_("Cannot copy messages to the Junk folder") },
};
static CamelVeeFolderClass *camel_vtrash_folder_parent;
@@ -112,6 +115,7 @@ camel_vtrash_folder_new (CamelStore *parent_store, enum _camel_vtrash_folder_t t
((CamelFolder *)vtrash)->folder_flags |= vdata[type].flags;
camel_vee_folder_set_expression((CamelVeeFolder *)vtrash, vdata[type].expr);
vtrash->bit = vdata[type].bit;
+ vtrash->type = type;
return (CamelFolder *)vtrash;
}
@@ -121,7 +125,8 @@ vtrash_append_message (CamelFolder *folder, CamelMimeMessage *message,
const CamelMessageInfo *info, char **appended_uid,
CamelException *ex)
{
- /* no-op */
+ camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
+ _(vdata[((CamelVTrashFolder *)folder)->type].error_copy));
}
struct _transfer_data {
@@ -168,12 +173,15 @@ vtrash_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
if (CAMEL_IS_VTRASH_FOLDER (dest)) {
/* Copy to trash is meaningless. */
- if (!delete_originals)
+ if (!delete_originals) {
+ camel_exception_setv(ex, CAMEL_EXCEPTION_SYSTEM,
+ _(vdata[((CamelVTrashFolder *)dest)->type].error_copy));
return;
+ }
/* Move to trash is the same as setting the message flag */
for (i = 0; i < uids->len; i++)
- camel_folder_set_message_flags(source, uids->pdata[i], sbit, ~0);
+ camel_folder_set_message_flags(source, uids->pdata[i], ((CamelVTrashFolder *)dest)->bit, ~0);
return;
}
diff --git a/camel/camel-vtrash-folder.h b/camel/camel-vtrash-folder.h
index a640569296..fcb9a927c0 100644
--- a/camel/camel-vtrash-folder.h
+++ b/camel/camel-vtrash-folder.h
@@ -51,6 +51,7 @@ enum _camel_vtrash_folder_t {
struct _CamelVTrashFolder {
CamelVeeFolder parent;
+ enum _camel_vtrash_folder_t type;
guint32 bit;
};