From 944fdf5ac66142b7da9d6c383cd305017aea399d Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 9 Oct 2002 17:30:06 +0000 Subject: The CamelFolderInfo that we get back has nodes for all parent folders, so 2002-10-08 Jeffrey Stedfast * component-factory.c (storage_remove_folder): The CamelFolderInfo that we get back has nodes for all parent folders, so do not delete all folders that have nodes in the returned tree. Instead, descend into the tree until we find the folder we want to delete and start deleting from there. svn path=/trunk/; revision=18357 --- mail/ChangeLog | 8 ++++++++ mail/component-factory.c | 13 +++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 40ce345892..737de40030 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2002-10-08 Jeffrey Stedfast + + * component-factory.c (storage_remove_folder): The CamelFolderInfo + that we get back has nodes for all parent folders, so do not + delete all folders that have nodes in the returned tree. Instead, + descend into the tree until we find the folder we want to delete + and start deleting from there. + 2002-10-08 Jeffrey Stedfast * mail-signature-editor.c (mail_signature_editor): Mark a string diff --git a/mail/component-factory.c b/mail/component-factory.c index da74969be4..b85f7e287d 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -1258,13 +1258,22 @@ storage_remove_folder (EvolutionStorage *storage, if (!root || camel_exception_is_set (&ex)) goto exception; + /* walk the tree until we find the particular child folder we want to delete */ fi = root; - while (fi && !camel_exception_is_set (&ex)) { + while (fi) { + if (!strcmp (fi->path, path)) + break; + fi = fi->child; + } + + if (fi != NULL) { storage_remove_folder_recursive (storage, store, fi, &ex); if (camel_exception_is_set (&ex)) goto exception; - fi = fi->sibling; + } else { + notify_listener (listener, GNOME_Evolution_Storage_INVALID_URI); } + camel_store_free_folder_info (store, root); notify_listener (listener, GNOME_Evolution_Storage_OK); -- cgit v1.2.3