aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2011-04-15 21:57:39 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:55 +0800
commit51d8920dfc73436e8c516f47f7bec00bc71583f9 (patch)
tree3cb997e919e2e9f7d78e609de1500886a684b61d
parent9aca4aa8e1103872028a20256bd4dbbd633ebac4 (diff)
downloadgsoc2013-evolution-51d8920dfc73436e8c516f47f7bec00bc71583f9.tar
gsoc2013-evolution-51d8920dfc73436e8c516f47f7bec00bc71583f9.tar.gz
gsoc2013-evolution-51d8920dfc73436e8c516f47f7bec00bc71583f9.tar.bz2
gsoc2013-evolution-51d8920dfc73436e8c516f47f7bec00bc71583f9.tar.lz
gsoc2013-evolution-51d8920dfc73436e8c516f47f7bec00bc71583f9.tar.xz
gsoc2013-evolution-51d8920dfc73436e8c516f47f7bec00bc71583f9.tar.zst
gsoc2013-evolution-51d8920dfc73436e8c516f47f7bec00bc71583f9.zip
Bug 647816 - Moving folder hierarchy causes error
When *moving*, as opposed to copying, we only need to operate on the top-level folder; its children will automatically follow it.
-rw-r--r--mail/em-folder-utils.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index eed9298f07..5e21fc47f2 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -105,9 +105,13 @@ emft_copy_folders__exec (struct _EMCopyFolders *m,
gint fromlen;
flags = CAMEL_STORE_FOLDER_INFO_FAST |
- CAMEL_STORE_FOLDER_INFO_RECURSIVE |
CAMEL_STORE_FOLDER_INFO_SUBSCRIBED;
+ /* If we're copying, then we need to copy every subfolder. If we're
+ *moving*, though, then we only need to rename the top-level folder */
+ if (!m->delete)
+ flags |= CAMEL_STORE_FOLDER_INFO_RECURSIVE;
+
fi = camel_store_get_folder_info_sync (
m->fromstore, m->frombase, flags, cancellable, error);
if (fi == NULL)
@@ -135,7 +139,10 @@ emft_copy_folders__exec (struct _EMCopyFolders *m,
GPtrArray *uids;
gint deleted = 0;
- if (info->child)
+ /* We still get immediate children even without the
+ CAMEL_STORE_FOLDER_INFO_RECURSIVE flag. But we only
+ want to process the children too if we're *copying* */
+ if (info->child && !m->delete)
pending = g_list_append (pending, info->child);
if (m->tobase[0])