merge of '5547fe230efee84f5079734d9e6dccd6e02bc161'

and '856583f8779d38a6978fe4db950c4067c8a38e9c'

Monotone-Parent: 5547fe230efee84f5079734d9e6dccd6e02bc161
Monotone-Parent: 856583f8779d38a6978fe4db950c4067c8a38e9c
Monotone-Revision: 065f29d26993d0476f752244bc9a97e2e8c8dcaa

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-07-01T19:58:59
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-07-01 19:58:59 +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];