mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-30 19:20:37 +00:00
Remove extra call to setSelected: in selectAll: deselectAll: etc methods, this should only happen in setSelectionIndexes and setSelectionIndexPaths
This commit is contained in:
parent
b6048a27f4
commit
ea398eab4c
1 changed files with 9 additions and 22 deletions
|
@ -1997,15 +1997,11 @@ static NSString *_placeholderItem = nil;
|
|||
NSMutableSet *paths = [NSMutableSet setWithCapacity: [_itemsToIndexPaths count]];
|
||||
|
||||
FOR_IN(NSCollectionViewItem*, obj, _itemsToIndexPaths)
|
||||
{
|
||||
if ([obj respondsToSelector: @selector(setSelected:)])
|
||||
{
|
||||
NSIndexPath *p = [_itemsToIndexPaths objectForKey: obj];
|
||||
|
||||
[obj setSelected: YES];
|
||||
[paths addObject: p];
|
||||
}
|
||||
}
|
||||
END_FOR_IN(_itemsToIndexPaths);
|
||||
|
||||
[self setSelectionIndexPaths: paths];
|
||||
|
@ -2016,15 +2012,12 @@ static NSString *_placeholderItem = nil;
|
|||
NSMutableSet *paths = [NSMutableSet setWithCapacity: [_itemsToIndexPaths count]];
|
||||
|
||||
FOR_IN(NSCollectionViewItem*, obj, _itemsToIndexPaths)
|
||||
{
|
||||
if ([obj respondsToSelector: @selector(setSelected:)])
|
||||
{
|
||||
NSIndexPath *p = [_itemsToIndexPaths objectForKey: obj];
|
||||
|
||||
[obj setSelected: NO];
|
||||
[paths addObject: p];
|
||||
}
|
||||
}
|
||||
END_FOR_IN(_itemsToIndexPaths);
|
||||
|
||||
[self deselectItemsAtIndexPaths: paths];
|
||||
|
@ -2039,12 +2032,9 @@ static NSString *_placeholderItem = nil;
|
|||
{
|
||||
id item = [_indexPathsToItems objectForKey: p];
|
||||
|
||||
if ([item respondsToSelector: @selector(setSelected:)])
|
||||
{
|
||||
[item setSelected: YES];
|
||||
[paths addObject: p];
|
||||
}
|
||||
}
|
||||
END_FOR_IN(indexPaths);
|
||||
|
||||
[self setSelectionIndexPaths: paths];
|
||||
|
@ -2058,12 +2048,9 @@ static NSString *_placeholderItem = nil;
|
|||
{
|
||||
id item = [_indexPathsToItems objectForKey: p];
|
||||
|
||||
if ([item respondsToSelector: @selector(setSelected:)])
|
||||
{
|
||||
[item setSelected: NO];
|
||||
[newSelection removeObject: p];
|
||||
}
|
||||
}
|
||||
END_FOR_IN(indexPaths);
|
||||
|
||||
[self setSelectionIndexPaths: newSelection];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue