Handle ExpandedFolders settings like in v3

This implies a transition where ExpandedFolders can be either a string
or an array.
This commit is contained in:
Francis Lachapelle 2015-11-11 13:31:58 -05:00
parent 82114f75aa
commit da230410be

View file

@ -335,12 +335,17 @@
- (WOResponse *) getFoldersStateAction - (WOResponse *) getFoldersStateAction
{ {
NSString *expandedFolders; id o;
NSArray *expandedFolders;
[self _setupContext]; [self _setupContext];
expandedFolders = [moduleSettings objectForKey: @"ExpandedFolders"]; o = [moduleSettings objectForKey: @"ExpandedFolders"];
if ([o isKindOfClass: [NSString class]])
expandedFolders = [o componentsSeparatedByString: @","];
else
expandedFolders = o;
return [self responseWithStatus: 200 andString: expandedFolders]; return [self responseWithStatus: 200 andJSONRepresentation: expandedFolders];
} }
- (NSString *) verticalDragHandleStyle - (NSString *) verticalDragHandleStyle
@ -404,7 +409,7 @@
request = [context request]; request = [context request];
expandedFolders = [request formValueForKey: @"expandedFolders"]; expandedFolders = [request formValueForKey: @"expandedFolders"];
[moduleSettings setObject: expandedFolders [moduleSettings setObject: [expandedFolders componentsSeparatedByString: @","]
forKey: @"ExpandedFolders"]; forKey: @"ExpandedFolders"];
[us synchronize]; [us synchronize];