mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-19 05:33:20 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user