Changeset 2363


Ignore:
Timestamp:
Jul 15, 2007, 9:57:42 PM (15 years ago)
Author:
livings124
Message:

get the mac os build building again

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r2357 r2363  
    446446{
    447447    if ([fTorrents count] == 1)
     448    {
     449        [[fTorrents objectAtIndex: 0] updateFileStat];
    448450        [fFileOutline reloadData];
     451    }
    449452}
    450453
  • trunk/macosx/Torrent.h

    r2357 r2363  
    5454    NSMutableString * fNameString, * fProgressString, * fStatusString, * fShortStatusString, * fRemainingTimeString;
    5555   
     56    tr_file_stat_t * fileStat;
    5657    NSArray * fFileList, * fFlatFileList;
    5758   
     
    202203- (NSArray *) fileList;
    203204- (int) fileCount;
     205- (void) updateFileStat;
     206
     207//methods require fileStats to have been updated recently to be accurate
    204208- (float) fileProgress: (int) index;
    205209- (int) checkForFiles: (NSIndexSet *) indexSet;
  • trunk/macosx/Torrent.m

    r2357 r2363  
    171171- (void) dealloc
    172172{
     173    if (fileStat)
     174        tr_torrentFilesFree(fileStat, [self fileCount]);
     175   
    173176    [fDownloadFolder release];
    174177    [fIncompleteFolder release];
     
    12821285}
    12831286
     1287- (void) updateFileStat
     1288{
     1289    if (fileStat)
     1290        tr_torrentFilesFree(fileStat, [self fileCount]);
     1291   
     1292    int count;
     1293    fileStat = tr_torrentFiles(fHandle, &count);
     1294}
     1295
    12841296- (float) fileProgress: (int) index
    12851297{
    1286     return tr_torrentFileCompletion(fHandle, index);
     1298    if (!fileStat)
     1299        [self updateFileStat];
     1300       
     1301    return fileStat[index].progress;
    12871302}
    12881303
     
    13091324        return NO;
    13101325   
     1326    if (!fileStat)
     1327        [self updateFileStat];
     1328   
    13111329    int index;
    13121330    for (index = [indexSet firstIndex]; index != NSNotFound; index = [indexSet indexGreaterThanIndex: index])
    1313         if (tr_torrentGetFileStatus(fHandle, index) != TR_CP_COMPLETE)
     1331        if (fileStat[index].completionStatus != TR_CP_COMPLETE)
    13141332            return YES;
    13151333    return NO;
Note: See TracChangeset for help on using the changeset viewer.