aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-vee-folder.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-03-27 09:41:21 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-03-27 09:41:21 +0800
commitefddd51d3b67fbf48a6c190fa7ddfb0244be5ddf (patch)
treef66dfbe73b34497b294dc65663c668169a5a1e92 /camel/camel-vee-folder.c
parent7b792443de265dbc80d29011bd1c200e515463c8 (diff)
downloadgsoc2013-evolution-efddd51d3b67fbf48a6c190fa7ddfb0244be5ddf.tar.gz
gsoc2013-evolution-efddd51d3b67fbf48a6c190fa7ddfb0244be5ddf.tar.zst
gsoc2013-evolution-efddd51d3b67fbf48a6c190fa7ddfb0244be5ddf.zip
Use camel_vtrash_folder_new() to create the vtrash folder now.
2001-03-26 Jeffrey Stedfast <fejj@ximian.com> * camel-store.c (init_trash): Use camel_vtrash_folder_new() to create the vtrash folder now. * camel-vtrash-folder.[c,h]: New subclass of CamelVeeFolder for our vTrash folders. * camel-folder.c (camel_folder_copy_messages_to): Don't watch for vtrash folders anymore. (camel_folder_move_messages_to): Same. * camel-vee-folder.c (camel_vee_folder_class_init): Update. (vee_move_messages_to): Rewrite to use the new move API. * camel-filter-driver.c (do_copy): Updated to reflect copy_message_to changes. Create a temporary uid array and use that. (do_move): Same. (camel_filter_driver_filter_message): And again, here... * providers/imap/camel-imap-folder.c (imap_copy_messages_to): Update to the new API. (imap_move_messages_to): Same. (get_uid_set): New function to create a `set' string based on an array of UIDs for use with imap_copy_messages_to. * camel-folder.c (camel_folder_copy_messages_to): Replaces camel_folder_copy_message_to (camel_folder_move_message_to): Replaces camel_folder_move_message_to. svn path=/trunk/; revision=8960
Diffstat (limited to 'camel/camel-vee-folder.c')
-rw-r--r--camel/camel-vee-folder.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index cfcf3175c7..1a54f8e657 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -56,7 +56,7 @@ static void vee_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
static void vee_expunge (CamelFolder *folder, CamelException *ex);
static CamelMimeMessage *vee_get_message (CamelFolder *folder, const gchar *uid, CamelException *ex);
-static void vee_move_message_to(CamelFolder *source, const char *uid, CamelFolder *dest, CamelException *ex);
+static void vee_move_messages_to(CamelFolder *source, GPtrArray *uids, CamelFolder *dest, CamelException *ex);
static GPtrArray *vee_search_by_expression(CamelFolder *folder, const char *expression, CamelException *ex);
@@ -119,7 +119,7 @@ camel_vee_folder_class_init (CamelVeeFolderClass *klass)
folder_class->expunge = vee_expunge;
folder_class->get_message = vee_get_message;
- folder_class->move_message_to = vee_move_message_to;
+ folder_class->move_messages_to = vee_move_messages_to;
folder_class->search_by_expression = vee_search_by_expression;
@@ -471,19 +471,28 @@ vee_set_message_user_flag(CamelFolder *folder, const char *uid, const char *name
}
static void
-vee_move_message_to(CamelFolder *folder, const char *uid, CamelFolder *dest, CamelException *ex)
+vee_move_messages_to (CamelFolder *folder, GPtrArray *uids, CamelFolder *dest, CamelException *ex)
{
CamelVeeMessageInfo *mi;
-
- mi = (CamelVeeMessageInfo *)camel_folder_summary_uid(folder->summary, uid);
- if (mi) {
- /* noop if it we're moving from the same vfolder (uh, which should't happen but who knows) */
- if (folder != mi->folder) {
- camel_folder_move_message_to(mi->folder, camel_message_info_uid(mi) + 8, dest, ex);
+ int i;
+
+ for (i = 0; i < uids->len && !camel_exception_is_set (ex); i++) {
+ mi = (CamelVeeMessageInfo *) camel_folder_summary_uid (folder->summary, uids->pdata[i]);
+ if (mi) {
+ /* noop if it we're moving from the same vfolder (uh, which should't happen but who knows) */
+ if (folder != mi->folder) {
+ GPtrArray *uids;
+
+ uids = g_ptr_array_new ();
+ g_ptr_array_add (uids, (char *) (camel_message_info_uid (mi) + 8));
+ camel_folder_move_messages_to (mi->folder, uids, dest, ex);
+ g_ptr_array_free (uids, TRUE);
+ }
+ camel_folder_summary_info_free (folder->summary, (CamelMessageInfo *)mi);
+ } else {
+ camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
+ _("No such message: %s"), uids->pdata[i]);
}
- camel_folder_summary_info_free(folder->summary, (CamelMessageInfo *)mi);
- } else {
- camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID, _("No such message: %s"), uid);
}
}