mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 00:10:47 +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]];
|
NSMutableSet *paths = [NSMutableSet setWithCapacity: [_itemsToIndexPaths count]];
|
||||||
|
|
||||||
FOR_IN(NSCollectionViewItem*, obj, _itemsToIndexPaths)
|
FOR_IN(NSCollectionViewItem*, obj, _itemsToIndexPaths)
|
||||||
{
|
|
||||||
if ([obj respondsToSelector: @selector(setSelected:)])
|
|
||||||
{
|
{
|
||||||
NSIndexPath *p = [_itemsToIndexPaths objectForKey: obj];
|
NSIndexPath *p = [_itemsToIndexPaths objectForKey: obj];
|
||||||
|
|
||||||
[obj setSelected: YES];
|
|
||||||
[paths addObject: p];
|
[paths addObject: p];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
END_FOR_IN(_itemsToIndexPaths);
|
END_FOR_IN(_itemsToIndexPaths);
|
||||||
|
|
||||||
[self setSelectionIndexPaths: paths];
|
[self setSelectionIndexPaths: paths];
|
||||||
|
@ -2016,15 +2012,12 @@ static NSString *_placeholderItem = nil;
|
||||||
NSMutableSet *paths = [NSMutableSet setWithCapacity: [_itemsToIndexPaths count]];
|
NSMutableSet *paths = [NSMutableSet setWithCapacity: [_itemsToIndexPaths count]];
|
||||||
|
|
||||||
FOR_IN(NSCollectionViewItem*, obj, _itemsToIndexPaths)
|
FOR_IN(NSCollectionViewItem*, obj, _itemsToIndexPaths)
|
||||||
{
|
|
||||||
if ([obj respondsToSelector: @selector(setSelected:)])
|
|
||||||
{
|
{
|
||||||
NSIndexPath *p = [_itemsToIndexPaths objectForKey: obj];
|
NSIndexPath *p = [_itemsToIndexPaths objectForKey: obj];
|
||||||
|
|
||||||
[obj setSelected: NO];
|
[obj setSelected: NO];
|
||||||
[paths addObject: p];
|
[paths addObject: p];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
END_FOR_IN(_itemsToIndexPaths);
|
END_FOR_IN(_itemsToIndexPaths);
|
||||||
|
|
||||||
[self deselectItemsAtIndexPaths: paths];
|
[self deselectItemsAtIndexPaths: paths];
|
||||||
|
@ -2039,12 +2032,9 @@ static NSString *_placeholderItem = nil;
|
||||||
{
|
{
|
||||||
id item = [_indexPathsToItems objectForKey: p];
|
id item = [_indexPathsToItems objectForKey: p];
|
||||||
|
|
||||||
if ([item respondsToSelector: @selector(setSelected:)])
|
|
||||||
{
|
|
||||||
[item setSelected: YES];
|
[item setSelected: YES];
|
||||||
[paths addObject: p];
|
[paths addObject: p];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
END_FOR_IN(indexPaths);
|
END_FOR_IN(indexPaths);
|
||||||
|
|
||||||
[self setSelectionIndexPaths: paths];
|
[self setSelectionIndexPaths: paths];
|
||||||
|
@ -2058,12 +2048,9 @@ static NSString *_placeholderItem = nil;
|
||||||
{
|
{
|
||||||
id item = [_indexPathsToItems objectForKey: p];
|
id item = [_indexPathsToItems objectForKey: p];
|
||||||
|
|
||||||
if ([item respondsToSelector: @selector(setSelected:)])
|
|
||||||
{
|
|
||||||
[item setSelected: NO];
|
[item setSelected: NO];
|
||||||
[newSelection removeObject: p];
|
[newSelection removeObject: p];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
END_FOR_IN(indexPaths);
|
END_FOR_IN(indexPaths);
|
||||||
|
|
||||||
[self setSelectionIndexPaths: newSelection];
|
[self setSelectionIndexPaths: newSelection];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue