Changeset 6232


Ignore:
Timestamp:
Jun 19, 2008, 4:37:05 PM (13 years ago)
Author:
livings124
Message:

improve method for determining number of displayed transfers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.m

    r6231 r6232  
    15631563    if (filtering)
    15641564    {
    1565         int count = 0, rows = [fTableView numberOfRows];
    1566         if (rows > 0 && ![[fTableView itemAtRow: 0] isKindOfClass: [Torrent class]])
    1567         {
    1568             int i;
    1569             for (i = 1; i < rows; i++)
    1570                 if ([[fTableView itemAtRow: i] isKindOfClass: [Torrent class]])
    1571                     count++;
    1572         }
    1573         else
    1574             count = rows;
     1565        int count = [fTableView numberOfRows]; //have to factor in collapsed rows
     1566        if (count > 0 && ![[fDisplayedTorrents objectAtIndex: 0] isKindOfClass: [Torrent class]])
     1567            count -= [fDisplayedTorrents count];
    15751568       
    15761569        totalTorrentsString = [NSString stringWithFormat: NSLocalizedString(@"%d of %@", "Status bar transfer count"),
     
    23542347   
    23552348    NSCalendar * calendar = [[NSCalendar alloc] initWithCalendarIdentifier: NSGregorianCalendar];
    2356     NSDateComponents * nowComponents = [calendar components: NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit
    2357                                         | NSHourCalendarUnit | NSMinuteCalendarUnit fromDate: [NSDate date]],
     2349    NSDateComponents * nowComponents = [calendar components: NSHourCalendarUnit | NSMinuteCalendarUnit fromDate: [NSDate date]],
    23582350                    * onComponents = [calendar components: NSHourCalendarUnit | NSMinuteCalendarUnit
    23592351                                        fromDate: [fDefaults objectForKey: @"SpeedLimitAutoOnDate"]],
Note: See TracChangeset for help on using the changeset viewer.