merge of '4540bdac2b25e94022f859ccd01e9fd4f28ef349'

and 'cc4465af2bc376a873ae8e59faf33b86548f08b3'

Monotone-Parent: 4540bdac2b25e94022f859ccd01e9fd4f28ef349
Monotone-Parent: cc4465af2bc376a873ae8e59faf33b86548f08b3
Monotone-Revision: 856583f8779d38a6978fe4db950c4067c8a38e9c

Monotone-Author: crobert@inverse.ca
Monotone-Date: 2009-07-01T19:30:11
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
C Robert
2009-07-01 19:30:11 +00:00
2 changed files with 23 additions and 1 deletions

View File

@@ -8,6 +8,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 <wsourdeau@inverse.ca>

View File

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