Changeset 568


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

Missed a small subtlety when selecting torrents when filtering.

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r567 r568  
    7878    NSArray                     * fAutoImportedNames;
    7979   
    80     BOOL                        fHasGrowl;
     80    BOOL                        fHasGrowl, fUpdateInProgress;
    8181    Badger                      * fBadger;
    82     BOOL                        fUpdateInProgress;
    8382}
    8483
     
    114113- (void) copyTorrentFileForTorrents: (NSMutableArray *) torrents;
    115114- (void) saveTorrentCopySheetClosed: (NSSavePanel *) panel returnCode: (int) code
    116     contextInfo: (NSMutableArray *) torrents;
     115            contextInfo: (NSMutableArray *) torrents;
    117116
    118117- (void) revealFile: (id) sender;
     
    127126
    128127- (void) sortTorrents;
    129 - (void) sortTorrentsChangeSelected: (BOOL) changeSelected;
     128- (void) sortTorrentsRememberSelected: (BOOL) changeSelected;
    130129- (void) setSort: (id) sender;
    131130- (void) applyFilter;
  • trunk/macosx/Controller.m

    r567 r568  
    857857- (void) sortTorrents
    858858{
    859     [self sortTorrentsChangeSelected: YES];
    860 }
    861 
    862 - (void) sortTorrentsChangeSelected: (BOOL) changeSelected
     859    [self sortTorrentsRememberSelected: YES];
     860}
     861
     862- (void) sortTorrentsRememberSelected: (BOOL) changeSelected
    863863{
    864864    //remember selected rows if needed
     
    966966{
    967967    //remember selected rows if needed
    968     NSArray * selectedTorrents = nil;
    969     int numSelected = [fTableView numberOfSelectedRows];
    970     if (numSelected > 0 && numSelected < [fFilteredTorrents count])
    971         selectedTorrents = [self torrentsAtIndexes: [fTableView selectedRowIndexes]];
     968    NSArray * selectedTorrents = [fTableView numberOfSelectedRows] > 0
     969                ? [self torrentsAtIndexes: [fTableView selectedRowIndexes]] : nil;
    972970
    973971    NSMutableArray * tempTorrents = [[NSMutableArray alloc] initWithCapacity: [fTorrents count]];
     
    10031001    [tempTorrents release];
    10041002   
    1005     [self sortTorrentsChangeSelected: NO];
    1006    
    1007     //set selected rows if needed...this selecting is more accurate than sort's
     1003    [self sortTorrentsRememberSelected: NO];
     1004   
     1005    //set selected rows if needed
    10081006    if (selectedTorrents)
    10091007    {
Note: See TracChangeset for help on using the changeset viewer.