Changeset 4231


Ignore:
Timestamp:
Dec 20, 2007, 1:06:55 AM (14 years ago)
Author:
livings124
Message:

a little more streamlining

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r4230 r4231  
    18221822    int downloading = 0, seeding = 0, paused = 0;
    18231823    NSString * filterType = [fDefaults stringForKey: @"Filter"];
    1824     BOOL filterDownload = [filterType isEqualToString: FILTER_DOWNLOAD],
    1825         filterSeed = [filterType isEqualToString: FILTER_SEED],
    1826         filterPause = [filterType isEqualToString: FILTER_PAUSE];
    1827    
    1828     int groupFilter = [fDefaults integerForKey: @"FilterGroup"];
     1824    BOOL filterDownload = NO, filterSeed = NO, filterPause = NO, filterStatus = YES;
     1825    if ([filterType isEqualToString: FILTER_DOWNLOAD])
     1826        filterDownload = YES;
     1827    else if ([filterType isEqualToString: FILTER_SEED])
     1828        filterSeed = YES;
     1829    else if ([filterType isEqualToString: FILTER_PAUSE])
     1830        filterPause = YES;
     1831    else
     1832        filterStatus = NO;
     1833   
     1834    int groupFilterValue = [fDefaults integerForKey: @"FilterGroup"];
     1835    BOOL filterGroup = groupFilterValue != GROUP_FILTER_ALL_TAG;
     1836   
    18291837    NSString * searchString = [fSearchFilterField stringValue];
    1830    
    1831     BOOL filterStatus = filterDownload || filterSeed || filterPause,
    1832         filterGroup = groupFilter != GROUP_FILTER_ALL_TAG,
    1833         filterText = [searchString length] > 0;
    1834    
    1835     BOOL filterTracker = filterText && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER];
     1838    BOOL filterText = [searchString length] > 0,
     1839        filterTracker = filterText && [[fDefaults stringForKey: @"FilterSearchType"] isEqualToString: FILTER_TYPE_TRACKER];
    18361840   
    18371841    NSMutableIndexSet * indexes = [NSMutableIndexSet indexSet];
     
    18701874        //checkGroup
    18711875        if (filterGroup)
    1872             if ([torrent groupValue] != groupFilter)
     1876            if ([torrent groupValue] != groupFilterValue)
    18731877                continue;
    18741878       
Note: See TracChangeset for help on using the changeset viewer.