Keep pathComponentCell and pathItems in sync

This commit is contained in:
Gregory John Casamento 2020-05-07 20:10:54 -04:00
parent 093844bb9a
commit 44cacc7766

View file

@ -233,6 +233,19 @@ static Class pathCellClass;
- (void) setPathItems: (NSArray *)items
{
NSEnumerator *en = [items objectEnumerator];
NSMutableArray *array = [NSMutableArray arrayWithCapacity: [items count]];
NSPathControlItem *item = nil;
while ((item = [en nextObject]) != nil)
{
NSPathComponentCell *cell = [[NSPathComponentCell alloc] init];
[cell setImage: [item image]];
[cell setURL: [item URL]];
[array addObject: cell];
}
[self setPathComponentCells: array];
ASSIGNCOPY(_pathItems, items);
[self setNeedsDisplay];
}