Changeset 9852


Ignore:
Timestamp:
Jan 2, 2010, 2:50:22 AM (12 years ago)
Author:
livings124
Message:

create file lists lazily

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.h

    r9844 r9852  
    205205
    206206- (NSArray *) fileList;
     207- (NSArray *) flatFileList;
    207208- (NSInteger) fileCount;
    208209- (void) updateFileStat;
    209 - (NSArray *) flatFileList;
    210210
    211211//methods require fileStats to have been updated recently to be accurate
  • trunk/macosx/Torrent.m

    r9844 r9852  
    12581258- (NSArray *) fileList
    12591259{
     1260    if (!fFileList && ![self isMagnet])
     1261        [self createFileList];
     1262   
    12601263    return fFileList;
     1264}
     1265
     1266- (NSArray *) flatFileList
     1267{
     1268    if (!fFlatFileList && ![self isMagnet])
     1269        [self createFileList];
     1270   
     1271    return fFlatFileList;
    12611272}
    12621273
     
    12931304    NSAssert([node size], @"directory in torrent file has size 0");
    12941305    return (CGFloat)have / [node size];
    1295 }
    1296 
    1297 - (NSArray *) flatFileList
    1298 {
    1299     return fFlatFileList;
    13001306}
    13011307
     
    15861592    fWaitToStart = waitToStart && [waitToStart boolValue];
    15871593    fResumeOnWake = NO;
    1588        
    1589     if (![self isMagnet])
    1590         [self createFileList];
    15911594       
    15921595    fGroupValue = groupValue ? [groupValue intValue] : [[GroupsController groups] groupIndexForTorrent: self];
     
    17381741    fStat = tr_torrentStat(fHandle);
    17391742   
    1740     [self createFileList];
    1741    
    17421743    [[NSNotificationCenter defaultCenter] postNotificationName: @"ResetInspector" object: self];
    17431744}
  • trunk/macosx/TrackerTableView.m

    r9844 r9852  
    136136    const CGFloat totalRowHeight = [self rowHeight] + [self intercellSpacing].height;
    137137   
    138     NSRect gridRects[(NSInteger)(ceil(visibleRect.size.height / totalRowHeight / 2.0)) + 1]; //add one if partial rows at top and bottom
     138    NSRect gridRects[(NSInteger)(ceil(NSHeight(visibleRect) / totalRowHeight / 2.0)) + 1]; //add one if partial rows at top and bottom
    139139    NSInteger rectNum = 0;
    140140   
Note: See TracChangeset for help on using the changeset viewer.