aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
author0 <NotZed@Ximian.com>2001-10-10 13:46:34 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-10 13:46:34 +0800
commit7ce7e097622ccf0a2946abd35a4f02c5dbb9e42e (patch)
treef821b4354f59f995f33146286baa08d013543eae /mail/mail-ops.c
parent14124e1c1639ef555dd0829ea74799525caf4374 (diff)
downloadgsoc2013-evolution-7ce7e097622ccf0a2946abd35a4f02c5dbb9e42e.tar.gz
gsoc2013-evolution-7ce7e097622ccf0a2946abd35a4f02c5dbb9e42e.tar.zst
gsoc2013-evolution-7ce7e097622ccf0a2946abd35a4f02c5dbb9e42e.zip
IF the source and destination folders are the same, do nothing. Oh, and
2001-10-10 <NotZed@Ximian.com> * mail-ops.c (transfer_messages_transfer): IF the source and destination folders are the same, do nothing. Oh, and return an error, otherwise the shell goes and removes it anyway. Fixes a rather serious bug with dnd of folders onto their current location. 2001-10-09 <NotZed@Ximian.com> * component-factory.c (owner_unset_cb): Disconnect from all the signals we were listening to, so we dont try and do shit twice on exit (one on unset_cb, one on destroy). (create_component): Setup the signal handlers using a table, so they're easier to disconnect on finish. svn path=/trunk/; revision=13545
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 009581b6d9..dd365b3fb5 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -866,7 +866,19 @@ transfer_messages_transfer (struct _mail_msg *mm)
void (*func) (CamelFolder *, GPtrArray *,
CamelFolder *,
CamelException *);
-
+
+ dest = mail_tool_uri_to_folder (m->dest_uri, m->dest_flags, &mm->ex);
+ if (camel_exception_is_set (&mm->ex))
+ return;
+
+ if (dest == m->source) {
+ camel_object_unref((CamelObject *)dest);
+ camel_exception_setv(&mm->ex, CAMEL_EXCEPTION_FOLDER_INVALID,
+ _("Cannot copy a folder `%s' to itself"),
+ m->dest_uri);
+ return;
+ }
+
if (m->delete) {
func = camel_folder_move_messages_to;
desc = _("Moving");
@@ -875,10 +887,6 @@ transfer_messages_transfer (struct _mail_msg *mm)
desc = _("Copying");
}
- dest = mail_tool_uri_to_folder (m->dest_uri, m->dest_flags, &mm->ex);
- if (camel_exception_is_set (&mm->ex))
- return;
-
camel_folder_freeze (m->source);
camel_folder_freeze (dest);