Changeset 567


Ignore:
Timestamp:
Jul 13, 2006, 12:39:46 AM (16 years ago)
Author:
livings124
Message:

no need to check and set selected twice

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r562 r567  
    127127
    128128- (void) sortTorrents;
     129- (void) sortTorrentsChangeSelected: (BOOL) changeSelected;
    129130- (void) setSort: (id) sender;
    130131- (void) applyFilter;
  • trunk/macosx/Controller.m

    r566 r567  
    857857- (void) sortTorrents
    858858{
     859    [self sortTorrentsChangeSelected: YES];
     860}
     861
     862- (void) sortTorrentsChangeSelected: (BOOL) changeSelected
     863{
    859864    //remember selected rows if needed
    860865    NSArray * selectedTorrents = nil;
    861     int numSelected = [fTableView numberOfSelectedRows];
    862     if (numSelected > 0 && numSelected < [fFilteredTorrents count])
    863         selectedTorrents = [self torrentsAtIndexes: [fTableView selectedRowIndexes]];
     866    if (changeSelected)
     867    {
     868        int numSelected = [fTableView numberOfSelectedRows];
     869        if (numSelected > 0 && numSelected < [fFilteredTorrents count])
     870            selectedTorrents = [self torrentsAtIndexes: [fTableView selectedRowIndexes]];
     871    }
    864872
    865873    NSSortDescriptor * nameDescriptor = [[[NSSortDescriptor alloc] initWithKey:
     
    9951003    [tempTorrents release];
    9961004   
    997     [self sortTorrents];
     1005    [self sortTorrentsChangeSelected: NO];
    9981006   
    9991007    //set selected rows if needed...this selecting is more accurate than sort's
Note: See TracChangeset for help on using the changeset viewer.