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.
This commit is contained in:
David Woodhouse
2011-04-15 14:57:39 +01:00
parent e3686d088b
commit d44fb9e2cf

View File

@ -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])