bookmark wasn't setting child options.

This commit is contained in:
Kelvin Sherlock 2021-06-13 16:45:01 -04:00
parent 7abb2f68a0
commit 681c70d515
1 changed files with 25 additions and 1 deletions

View File

@ -57,6 +57,7 @@ static NSArray *DeepCopyArray(NSArray *src) {
-(void)reset;
-(NSString *)keyPath;
-(void)setKeyPath: (NSString *)path;
-(void)buildArgs: (NSMutableArray *)args;
-(void)buildMedia: (Media *)media;
@ -160,6 +161,27 @@ static NSDictionary *IndexMap = nil;
[option reserialize: dict];
return;
}
// special case for child options since _name is incorrect.
// _name is :rs232. should be set to -sl3:ssc:rs232 :/
if (!_title) {
BOOL found = NO;
unsigned ix = 0;
for (SlotOption *option in _options) {
NSString *keyPath = [option keyPath];
NSString *value = [dict objectForKey: keyPath];
if (value && [value isEqualToString: [option value]]) {
[self setSelectedIndex: ix];
[option reserialize: dict];
found = YES;
break;
}
++ix;
}
return;
}
NSString *value = [dict objectForKey: _name];
if (!value) {
//[self reset];
@ -529,7 +551,9 @@ https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/KeyVa
[s setKeyPath: p];
}
}
-(NSString *)keyPath {
return _keyPath;
}
#if 0
-(BOOL)loadDeviceSlots: (NSDictionary *)devices {