Make folderKey encoding consistent

The folder names are encoded through the `asCSSIdentifier` and
`stringByEncodingImap4FolderName` functions when we store them as folder
keys. In addition, the prefix "folder" is added to the key.

The order in which these operations were done when storing the folder
keys (and reverted when retrieving them) wasn't consistent trough the
code. This led to problems such as creating twice a folder with a digit
at the beginning of its name.

The folder name goes now through the following operations when being
stored as a key (the retrieval reverts these in the reverse order):

 * `stringByEncodingImap4FolderName`
 * `asCSSIdentifier`
 * Add "folder" prefix
This commit is contained in:
Juan Vallés
2015-09-14 15:40:34 +02:00
parent 734aba5ddb
commit ba68bd8935
6 changed files with 27 additions and 25 deletions
+2 -2
View File
@@ -688,8 +688,8 @@
for (k = 0; k < [pathComponents count]; k++)
{
component = [NSString stringWithFormat: @"folder%@", [pathComponents objectAtIndex: k]];
[path appendString: [component asCSSIdentifier]];
component = [[pathComponents objectAtIndex: k] asCSSIdentifier];
[path appendString: [NSString stringWithFormat: @"folder%@", component]];
if (k < [pathComponents count] - 1)
[path appendString: @"/"];
}