1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 09:13:06 +00:00

when determining selected torrents, if a group is selected, after adding all torrents from that group, skip to the object after all those torrents

This commit is contained in:
Mitchell Livingston 2008-01-23 18:41:33 +00:00
parent 381a5bf4b5
commit 320e519a43

View file

@ -284,9 +284,10 @@
- (void) selectValues: (NSArray *) values
{
id object;
NSMutableIndexSet * indexSet = [NSMutableIndexSet indexSet];
NSEnumerator * enumerator = [values objectEnumerator];
NSMutableIndexSet * indexSet = [[NSMutableIndexSet alloc] init];
id object;
while ((object = [enumerator nextObject]))
{
unsigned index = [fTorrents indexOfObject: object]; //works with torrents and groups
@ -295,7 +296,6 @@
}
[self selectRowIndexes: indexSet byExtendingSelection: NO];
[indexSet release];
}
- (NSArray *) selectedValues
@ -319,6 +319,7 @@
{
int count = next != NSNotFound ? next - i - 1 : [fTorrents count] - i - 1;
[indexSet addIndexesInRange: NSMakeRange(i+1, count)];
i += count;
}
}
[fTorrents objectsAtIndexes: indexSet];