mirror of
https://github.com/transmission/transmission
synced 2024-12-25 01:03:01 +00:00
simplify some file view code...speed difference should be negligible
This commit is contained in:
parent
35dc48dc1d
commit
5975ae7a59
1 changed files with 10 additions and 24 deletions
|
@ -613,20 +613,13 @@
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
Torrent * torrent = [fTorrents objectAtIndex: 0];
|
Torrent * torrent = [fTorrents objectAtIndex: 0];
|
||||||
NSIndexSet * indexSet = [fFileOutline selectedRowIndexes], * itemIndexes;
|
NSIndexSet * indexSet = [fFileOutline selectedRowIndexes];
|
||||||
NSMutableIndexSet * usedIndexes = [NSMutableIndexSet indexSet];
|
NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet];
|
||||||
int i, index, state = (menuItem == fFileCheckItem) ? NSOnState : NSOffState;
|
int i, index, state = (menuItem == fFileCheckItem) ? NSOnState : NSOffState;
|
||||||
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
|
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
|
||||||
{
|
[itemIndexes addIndexes: [[fFileOutline itemAtRow: i] objectForKey: @"Indexes"]];
|
||||||
itemIndexes = [[fFileOutline itemAtRow: i] objectForKey: @"Indexes"];
|
|
||||||
if (![usedIndexes containsIndexes: itemIndexes])
|
return [torrent checkForFiles: itemIndexes] != state && [torrent canChangeDownloadCheckForFiles: itemIndexes];
|
||||||
{
|
|
||||||
if ([torrent checkForFiles: itemIndexes] != state && [torrent canChangeDownloadCheckForFiles: itemIndexes])
|
|
||||||
return YES;
|
|
||||||
[usedIndexes addIndexes: itemIndexes];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == @selector(setOnlySelectedCheck:))
|
if (action == @selector(setOnlySelectedCheck:))
|
||||||
|
@ -635,20 +628,13 @@
|
||||||
return NO;
|
return NO;
|
||||||
|
|
||||||
Torrent * torrent = [fTorrents objectAtIndex: 0];
|
Torrent * torrent = [fTorrents objectAtIndex: 0];
|
||||||
NSIndexSet * indexSet = [fFileOutline selectedRowIndexes], * itemIndexes;
|
NSIndexSet * indexSet = [fFileOutline selectedRowIndexes];
|
||||||
NSMutableIndexSet * usedIndexes = [NSMutableIndexSet indexSet];
|
NSMutableIndexSet * itemIndexes = [NSMutableIndexSet indexSet];
|
||||||
int i, index;
|
int i, index;
|
||||||
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
|
for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i])
|
||||||
{
|
[itemIndexes addIndexes: [[fFileOutline itemAtRow: i] objectForKey: @"Indexes"]];
|
||||||
itemIndexes = [[fFileOutline itemAtRow: i] objectForKey: @"Indexes"];
|
|
||||||
if (![usedIndexes containsIndexes: itemIndexes])
|
return [torrent canChangeDownloadCheckForFiles: itemIndexes];
|
||||||
{
|
|
||||||
if ([torrent canChangeDownloadCheckForFiles: itemIndexes])
|
|
||||||
return YES;
|
|
||||||
[usedIndexes addIndexes: itemIndexes];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return NO;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == @selector(setPriority:))
|
if (action == @selector(setPriority:))
|
||||||
|
|
Loading…
Reference in a new issue