From cf18d0940f9abbe8bb032d08a0fb33067def30d7 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 10 May 2002 16:46:04 +0000 Subject: Simplify. Use transfer_messages_to instead of picking between copy and * mail-ops.c (transfer_messages_transfer): Simplify. Use transfer_messages_to instead of picking between copy and move. Remove vtrash special-casing since it's all in camel-vtrash-folder.c now. Remove duplicate source == dest check. * mail-local.c (mail_local_folder_reconfigure): Use transfer_messages_to instead of copy_messages_to. svn path=/trunk/; revision=16745 --- mail/ChangeLog | 10 ++++++++++ mail/mail-local.c | 2 +- mail/mail-ops.c | 35 +---------------------------------- 3 files changed, 12 insertions(+), 35 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 5ec5c7b1d1..fcb6893bed 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,13 @@ +2002-05-10 Dan Winship + + * mail-ops.c (transfer_messages_transfer): Simplify. Use + transfer_messages_to instead of picking between copy and move. + Remove vtrash special-casing since it's all in + camel-vtrash-folder.c now. Remove duplicate source == dest check. + + * mail-local.c (mail_local_folder_reconfigure): Use + transfer_messages_to instead of copy_messages_to. + 2002-05-09 Jeffrey Stedfast * mail-account-gui.c (mail_account_gui_save): Make sure that even diff --git a/mail/mail-local.c b/mail/mail-local.c index a90d4ae15f..98a2c78e6f 100644 --- a/mail/mail-local.c +++ b/mail/mail-local.c @@ -686,7 +686,7 @@ mail_local_folder_reconfigure (MailLocalFolder *mlf, const char *new_format, int camel_folder_freeze(mlf->real_folder); uids = camel_folder_get_uids(fromfolder); - camel_folder_move_messages_to(fromfolder, uids, mlf->real_folder, ex); + camel_folder_transfer_messages_to(fromfolder, uids, mlf->real_folder, TRUE, ex); camel_folder_free_uids(fromfolder, uids); if (camel_exception_is_set(ex)) goto cleanup; diff --git a/mail/mail-ops.c b/mail/mail-ops.c index ae01d43c9c..f86a013a7a 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -924,10 +924,6 @@ transfer_messages_transfer (struct _mail_msg *mm) { struct _transfer_msg *m = (struct _transfer_msg *)mm; CamelFolder *dest; - char *desc; - 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)) @@ -939,39 +935,10 @@ transfer_messages_transfer (struct _mail_msg *mm) return; } - if (m->delete) { - func = camel_folder_move_messages_to; - desc = _("Moving"); - } else { - func = camel_folder_copy_messages_to; - desc = _("Copying"); - } - camel_folder_freeze (m->source); camel_folder_freeze (dest); - if (CAMEL_IS_VTRASH_FOLDER (dest)) { - if (m->delete) { - int i; - - /* Just mark all the messages as deleted */ - for (i = 0; i < m->uids->len; i++) - camel_folder_delete_message (m->source, m->uids->pdata[i]); - } else { - /* no-op - can't copy messages to*/ - } - } else { - if (dest == m->source) { - int i; - - /* Undelete the messages if they are marked as deleted */ - for (i = 0; i < m->uids->len; i++) - camel_folder_set_message_flags (m->source, m->uids->pdata[i], - CAMEL_MESSAGE_DELETED, 0); - } else { - (func) (m->source, m->uids, dest, &mm->ex); - } - } + camel_folder_transfer_messages_to (m->source, m->uids, dest, m->delete, &mm->ex); camel_folder_thaw (m->source); camel_folder_thaw (dest); -- cgit v1.2.3