mirror of
https://github.com/transmission/transmission
synced 2025-01-31 19:34:05 +00:00
Peer table always sorts by ip address after sorting by whatever column is selected.
This commit is contained in:
parent
d232d371b5
commit
1043035ce4
2 changed files with 18 additions and 2 deletions
|
@ -66,4 +66,6 @@
|
|||
|
||||
- (void) setWaitToStart: (id) sender;
|
||||
|
||||
- (NSArray *) peerSortDescriptors;
|
||||
|
||||
@end
|
||||
|
|
|
@ -265,7 +265,7 @@
|
|||
if (numberSelected == 1)
|
||||
{
|
||||
[fPeers setArray: [[fTorrents objectAtIndex: 0] peers]];
|
||||
[fPeers sortUsingDescriptors: [fPeerTable sortDescriptors]];
|
||||
[fPeers sortUsingDescriptors: [self peerSortDescriptors]];
|
||||
}
|
||||
else
|
||||
[fPeers removeAllObjects];
|
||||
|
@ -470,7 +470,7 @@
|
|||
{
|
||||
if (tableView == fPeerTable)
|
||||
{
|
||||
[fPeers sortUsingDescriptors: [tableView sortDescriptors]];
|
||||
[fPeers sortUsingDescriptors: [self peerSortDescriptors]];
|
||||
[tableView reloadData];
|
||||
}
|
||||
}
|
||||
|
@ -488,6 +488,20 @@
|
|||
return tableView == fFileTable ? [fFiles objectAtIndex: row] : nil;
|
||||
}
|
||||
|
||||
- (NSArray *) peerSortDescriptors
|
||||
{
|
||||
NSMutableArray * descriptors = [NSMutableArray array];
|
||||
|
||||
NSArray * oldDescriptors = [fPeerTable sortDescriptors];
|
||||
if ([oldDescriptors count] > 0)
|
||||
[descriptors addObject: [oldDescriptors objectAtIndex: 0]];
|
||||
|
||||
[descriptors addObject: [[[fPeerTable tableColumns] objectAtIndex: [fPeerTable columnWithIdentifier: @"IP"]]
|
||||
sortDescriptorPrototype]];
|
||||
|
||||
return descriptors;
|
||||
}
|
||||
|
||||
- (void) revealFile: (id) sender
|
||||
{
|
||||
NSIndexSet * indexSet = [fFileTable selectedRowIndexes];
|
||||
|
|
Loading…
Reference in a new issue