From 733cc4f9e7f2bdeb70d6378737acd3c7d0bf9d12 Mon Sep 17 00:00:00 2001 From: C Robert Date: Wed, 1 Jul 2009 19:28:44 +0000 Subject: [PATCH] Monotone-Parent: 52e582748151e87bfde51bfd7c475d994270767b Monotone-Revision: cc4465af2bc376a873ae8e59faf33b86548f08b3 Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-07-01T19:28:44 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ UI/MailerUI/UIxMailFolderActions.m | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e636756ac..67edd4843 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * SoObjects/SOGo/SOGoGCSFolder.m: Remove color from user settings on unsubscribe. + * UI/MailerUI/UIxMailFolderActions.m (_trashedURLOfFolder:withCO:): Fixed + issue when deleting a folder with the same name as one already in the Trash. 2009-06-30 Wolfgang Sourdeau diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index 27a381d4a..81a056d1c 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -139,13 +139,33 @@ withCO: (SOGoMailFolder *) co { NSURL *destURL; - NSString *trashFolderName, *folderName, *path; + NSString *trashFolderName, *folderName, *path, *testPath; + NGImap4Connection *connection; + int i = 1; + id test; + + connection = [co imap4Connection]; folderName = [[srcURL path] lastPathComponent]; trashFolderName = [[co mailAccountFolder] trashFolderNameInContext: context]; path = [NSString stringWithFormat: @"/%@/%@", trashFolderName, folderName]; + testPath = path; + while ( i < 10 ) + { + test = [[connection client] select: testPath]; + if (test && [[test objectForKey: @"result"] boolValue]) + { + testPath = [NSString stringWithFormat: @"%@%x", path, i]; + i++; + } + else + { + path = testPath; + break; + } + } destURL = [[NSURL alloc] initWithScheme: [srcURL scheme] host: [srcURL host] path: path]; [destURL autorelease];