Monotone-Parent: 1fb3121c84e0bb2773973fcfde109c7b26530951

Monotone-Revision: e2f910a1982b774a3f5dfd586d968821441f2076

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-17T17:56:25
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2012-08-17 17:56:25 +00:00
parent 90e226d5bb
commit fb297c913c
5 changed files with 32 additions and 17 deletions
+5 -2
View File
@@ -206,12 +206,14 @@ MakeDisplayFolderName (NSString *folderName)
- (void) updateURLWithFolderName: (NSString *) newFolderName
{
NSString *urlString;
NSString *urlString, *escapedName;
NSMutableArray *pathComponents;
BOOL hasSlash;
NSUInteger max, folderNameIdx;
NSURL *newURL;
/* we do not need to unescape the url here as it will be reassembled later
in the method */
urlString = [contextUrl absoluteString];
hasSlash = [urlString hasSuffix: @"/"];
pathComponents = [[urlString componentsSeparatedByString: @"/"]
@@ -222,8 +224,9 @@ MakeDisplayFolderName (NSString *folderName)
folderNameIdx = max - 2;
else
folderNameIdx = max - 1;
escapedName = [newFolderName stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
[pathComponents replaceObjectAtIndex: folderNameIdx
withObject: [newFolderName stringByEscapingURL]];
withObject: escapedName];
urlString = [pathComponents componentsJoinedByString: @"/"];
newURL = [NSURL URLWithString: urlString];
ASSIGN (contextUrl, newURL);