diff options
author | Dan Winship <danw@src.gnome.org> | 2002-05-11 00:44:36 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2002-05-11 00:44:36 +0800 |
commit | 6952dcb7c0821d705fad562ff5b96613b7c7b248 (patch) | |
tree | 8610ea39d3c105a615318c00145897adb5dc00cf /camel/camel-disco-folder.c | |
parent | 409f147b81748829457ee9110ccd0488ad9bfbf4 (diff) | |
download | gsoc2013-evolution-6952dcb7c0821d705fad562ff5b96613b7c7b248.tar.gz gsoc2013-evolution-6952dcb7c0821d705fad562ff5b96613b7c7b248.tar.zst gsoc2013-evolution-6952dcb7c0821d705fad562ff5b96613b7c7b248.zip |
Replace copy_messages_to and move_messages_to with a single function that
* camel-folder.c (camel_folder_transfer_messages_to): Replace
copy_messages_to and move_messages_to with a single function that
just takes a "delete_originals" flag. Also, use the vtrash
implementation if *either* folder is a vtrash.
(transfer_messages_to): Make this use camel_operation_progress
(previously move_messages_to did but copy_messages_to didn't), and
freeze/thaw the folder(s) if doing multiple messages.
* camel-vtrash-folder.c (vtrash_transfer_messages_to): Update for
move/copy merge. Move the "move messages into vtrash" code here
from mail-ops.c. Now all of the vtrash move/copy special casing is
in camel instead of half of it being here and half in mail/. (This
should also make it so that "Move to Trash" will work in filter
rules.)
* camel-vee-folder.c (vee_transfer_messages_to): Make this just
return an exception, since it will only be called when trying to
move/copy messages from one vfolder to another.
(vee_append_message): Add this too so we get a nicer error message
than the default "unimplemented" one in camel-folder.c.
* camel-digest-folder.c: Replace copy_messages_to and
move_messages_to with transfer_messages_to.
* camel-disco-folder.c: Likewise
* camel-disco-diary.c (camel_disco_diary_log,
camel_disco_diary_replay): replace MOVE/COPY with TRANSFER.
* providers/imap/camel-imap-folder.c (imap_transfer_offline,
imap_transfer_online, imap_transfer_resyncing): Update for
changes. (This ends up being a bit more complicated than it was
before for now, but later disconnected operation changes should
resimplify it.)
* camel-filter-driver.c (camel_filter_driver_filter_message,
do_copy, do_move): Use transfer_messages_to instead of copy.
svn path=/trunk/; revision=16744
Diffstat (limited to 'camel/camel-disco-folder.c')
-rw-r--r-- | camel/camel-disco-folder.c | 46 |
1 files changed, 14 insertions, 32 deletions
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c index eb3d8633aa..d7c385c60b 100644 --- a/camel/camel-disco-folder.c +++ b/camel/camel-disco-folder.c @@ -40,10 +40,10 @@ static void disco_expunge (CamelFolder *folder, CamelException *ex); static void disco_append_message (CamelFolder *folder, CamelMimeMessage *message, const CamelMessageInfo *info, CamelException *ex); -static void disco_copy_messages_to (CamelFolder *source, GPtrArray *uids, - CamelFolder *destination, CamelException *ex); -static void disco_move_messages_to (CamelFolder *source, GPtrArray *uids, - CamelFolder *destination, CamelException *ex); +static void disco_transfer_messages_to (CamelFolder *source, GPtrArray *uids, + CamelFolder *destination, + gboolean delete_originals, + CamelException *ex); static void disco_cache_message (CamelDiscoFolder *disco_folder, const char *uid, CamelException *ex); @@ -68,8 +68,7 @@ camel_disco_folder_class_init (CamelDiscoFolderClass *camel_disco_folder_class) camel_folder_class->expunge = disco_expunge; camel_folder_class->append_message = disco_append_message; - camel_folder_class->copy_messages_to = disco_copy_messages_to; - camel_folder_class->move_messages_to = disco_move_messages_to; + camel_folder_class->transfer_messages_to = disco_transfer_messages_to; } CamelType @@ -190,43 +189,26 @@ disco_append_message (CamelFolder *folder, CamelMimeMessage *message, } static void -disco_copy_messages_to (CamelFolder *source, GPtrArray *uids, - CamelFolder *destination, CamelException *ex) +disco_transfer_messages_to (CamelFolder *source, GPtrArray *uids, + CamelFolder *destination, + gboolean delete_originals, CamelException *ex) { CamelDiscoStore *disco = CAMEL_DISCO_STORE (source->parent_store); switch (camel_disco_store_status (disco)) { case CAMEL_DISCO_STORE_ONLINE: - CDF_CLASS (source)->copy_online (source, uids, destination, ex); + CDF_CLASS (source)->transfer_online (source, uids, destination, + delete_originals, ex); break; case CAMEL_DISCO_STORE_OFFLINE: - CDF_CLASS (source)->copy_offline (source, uids, destination, ex); + CDF_CLASS (source)->transfer_offline (source, uids, destination, + delete_originals, ex); break; case CAMEL_DISCO_STORE_RESYNCING: - CDF_CLASS (source)->copy_resyncing (source, uids, destination, ex); - break; - } -} - -static void -disco_move_messages_to (CamelFolder *source, GPtrArray *uids, - CamelFolder *destination, CamelException *ex) -{ - CamelDiscoStore *disco = CAMEL_DISCO_STORE (source->parent_store); - - switch (camel_disco_store_status (disco)) { - case CAMEL_DISCO_STORE_ONLINE: - CDF_CLASS (source)->move_online (source, uids, destination, ex); - break; - - case CAMEL_DISCO_STORE_OFFLINE: - CDF_CLASS (source)->move_offline (source, uids, destination, ex); - break; - - case CAMEL_DISCO_STORE_RESYNCING: - CDF_CLASS (source)->move_resyncing (source, uids, destination, ex); + CDF_CLASS (source)->transfer_resyncing (source, uids, destination, + delete_originals, ex); break; } } |