mirror of
https://github.com/transmission/transmission
synced 2025-03-08 12:54:40 +00:00
fix a problem with groups on 10.4
This commit is contained in:
parent
8d14a789cb
commit
dd116cc2bc
2 changed files with 8 additions and 5 deletions
|
@ -1793,16 +1793,18 @@ void sleepCallBack(void * controller, io_service_t y, natural_t messageType, voi
|
|||
- (void) applyFilter: (id) sender
|
||||
{
|
||||
//get all the torrents in the table
|
||||
NSMutableArray * previousTorrents = [NSMutableArray array];
|
||||
NSMutableArray * previousTorrents;
|
||||
if ([fDisplayedTorrents count] > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]])
|
||||
{
|
||||
previousTorrents = [NSMutableArray array];
|
||||
|
||||
NSEnumerator * enumerator = [fDisplayedTorrents objectEnumerator];
|
||||
NSDictionary * dict;
|
||||
while ((dict = [enumerator nextObject]))
|
||||
[previousTorrents addObjectsFromArray: [dict objectForKey: @"Torrents"]];
|
||||
}
|
||||
else
|
||||
[previousTorrents setArray: fDisplayedTorrents];
|
||||
previousTorrents = [NSMutableArray arrayWithArray: fDisplayedTorrents];
|
||||
|
||||
NSArray * selectedValues = [fTableView selectedValues];
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
|
||||
NSData * groupData = [fDefaults dataForKey: @"CollapsedGroups"];
|
||||
if (groupData)
|
||||
fCollapsedGroups = [[NSUnarchiver unarchiveObjectWithData: groupData] retain];
|
||||
fCollapsedGroups = [[NSUnarchiver unarchiveObjectWithData: groupData] mutableCopy];
|
||||
else
|
||||
fCollapsedGroups = [[NSMutableIndexSet alloc] init];
|
||||
|
||||
|
@ -359,11 +359,12 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
int group = [[item objectForKey: @"Group"] intValue], i;
|
||||
NSNumber * group = [item objectForKey: @"Group"];
|
||||
int i;
|
||||
for (i = 0; i < [self numberOfRows]; i++)
|
||||
{
|
||||
id tableItem = [self itemAtRow: i];
|
||||
if (![tableItem isKindOfClass: [Torrent class]] && [[tableItem objectForKey: @"Group"] intValue] == group)
|
||||
if (![tableItem isKindOfClass: [Torrent class]] && [group isEqualToNumber: [tableItem objectForKey: @"Group"]])
|
||||
{
|
||||
[indexSet addIndex: i];
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue