Changeset 776


Ignore:
Timestamp:
Aug 14, 2006, 11:18:49 PM (15 years ago)
Author:
livings124
Message:

Peer table always sorts by ip address after sorting by whatever column is selected.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.h

    r761 r776  
    6767- (void) setWaitToStart: (id) sender;
    6868
     69- (NSArray *) peerSortDescriptors;
     70
    6971@end
  • trunk/macosx/InfoWindowController.m

    r775 r776  
    266266    {
    267267        [fPeers setArray: [[fTorrents objectAtIndex: 0] peers]];
    268         [fPeers sortUsingDescriptors: [fPeerTable sortDescriptors]];
     268        [fPeers sortUsingDescriptors: [self peerSortDescriptors]];
    269269    }
    270270    else
     
    471471    if (tableView == fPeerTable)
    472472    {
    473         [fPeers sortUsingDescriptors: [tableView sortDescriptors]];
     473        [fPeers sortUsingDescriptors: [self peerSortDescriptors]];
    474474        [tableView reloadData];
    475475    }
     
    487487{
    488488    return tableView == fFileTable ? [fFiles objectAtIndex: row] : nil;
     489}
     490
     491- (NSArray *) peerSortDescriptors
     492{
     493    NSMutableArray * descriptors = [NSMutableArray array];
     494   
     495    NSArray * oldDescriptors = [fPeerTable sortDescriptors];
     496    if ([oldDescriptors count] > 0)
     497        [descriptors addObject: [oldDescriptors objectAtIndex: 0]];
     498   
     499    [descriptors addObject: [[[fPeerTable tableColumns] objectAtIndex: [fPeerTable columnWithIdentifier: @"IP"]]
     500                                sortDescriptorPrototype]];
     501   
     502    return descriptors;
    489503}
    490504
Note: See TracChangeset for help on using the changeset viewer.