mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 06:51:44 +00:00
Don't update the delegate unless the selection actually changes
This commit is contained in:
parent
a6f83ab00b
commit
e9e1615cdb
1 changed files with 10 additions and 5 deletions
|
@ -440,17 +440,22 @@ static NSString *placeholderItem = nil;
|
|||
return;
|
||||
}
|
||||
|
||||
if ([_selectionIndexPaths isEqual: indexPaths])
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
ASSIGN(_selectionIndexPaths, indexPaths);
|
||||
}
|
||||
|
||||
|
||||
if ([_delegate respondsToSelector: @selector(collectionView:shouldSelectItemsAtIndexPaths:)])
|
||||
{
|
||||
indexPaths = [_delegate collectionView: self
|
||||
shouldSelectItemsAtIndexPaths: indexPaths];
|
||||
}
|
||||
|
||||
if (![_selectionIndexPaths isEqual: indexPaths])
|
||||
{
|
||||
ASSIGN(_selectionIndexPaths, indexPaths);
|
||||
}
|
||||
|
||||
// First unselect all of the items
|
||||
FOR_IN(id, item, _visibleItems)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue