Ignore:
Timestamp:
Feb 11, 2008, 12:16:47 AM (15 years ago)
Author:
livings124
Message:

insignificant filtering improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r5002 r5004  
    18051805    }
    18061806    else
    1807         previousTorrents = [NSMutableArray arrayWithArray: fDisplayedTorrents];
     1807        previousTorrents = fDisplayedTorrents;
    18081808   
    18091809    NSArray * selectedValues = [fTableView selectedValues];
     
    19091909    }
    19101910   
    1911     [fDisplayedTorrents setArray: [fTorrents objectsAtIndexes: indexes]];
     1911    NSArray * allTorrents = [fTorrents objectsAtIndexes: indexes];
    19121912   
    19131913    //set button tooltips
     
    19191919   
    19201920    //clear display cache for not-shown torrents
    1921     [previousTorrents removeObjectsInArray: fDisplayedTorrents];
     1921    [previousTorrents removeObjectsInArray: allTorrents];
    19221922    enumerator = [previousTorrents objectEnumerator];
    19231923    while ((torrent = [enumerator nextObject]))
     
    19291929    {
    19301930        NSSortDescriptor * groupDescriptor = [[[NSSortDescriptor alloc] initWithKey: @"groupOrderValue" ascending: YES] autorelease];
    1931         [fDisplayedTorrents sortUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]];
     1931        allTorrents = [allTorrents sortedArrayUsingDescriptors: [NSArray arrayWithObject: groupDescriptor]];
    19321932       
    19331933        NSMutableArray * groups = [NSMutableArray array], * groupTorrents;
    19341934        int oldGroupValue = -2;
    1935         for (i = 0; i < [fDisplayedTorrents count]; i++)
    1936         {
    1937             Torrent * torrent = [fDisplayedTorrents objectAtIndex: i];
     1935        for (i = 0; i < [allTorrents count]; i++)
     1936        {
     1937            Torrent * torrent = [allTorrents objectAtIndex: i];
    19381938            int groupValue = [torrent groupValue];
    19391939            if (groupValue != oldGroupValue)
     
    19521952        [fDisplayedTorrents setArray: groups];
    19531953    }
     1954    else
     1955        [fDisplayedTorrents setArray: allTorrents];
    19541956   
    19551957    //actually sort
Note: See TracChangeset for help on using the changeset viewer.