Changeset 5049


Ignore:
Timestamp:
Feb 16, 2008, 7:32:22 PM (13 years ago)
Author:
livings124
Message:

in minimal mode, show eta for seeding

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.h

    r4930 r5049  
    5757    NSImage * fIcon;
    5858   
    59     NSString * fHashString;
     59    NSString * fNameString, * fHashString;
    6060   
    6161    tr_file_stat * fileStat;
  • trunk/macosx/Torrent.m

    r5035 r5049  
    176176    [fFinishedPiecesDate release];
    177177   
     178    [fNameString release];
    178179    [fHashString release];
    179180   
     
    661662- (NSString *) name
    662663{
    663     return [NSString stringWithUTF8String: fInfo->name];
     664    return fNameString;
    664665}
    665666
     
    709710- (NSString *) comment
    710711{
    711     return fInfo->comment != NULL ? [NSString stringWithUTF8String: fInfo->comment] : @"";
     712    return [NSString stringWithUTF8String: fInfo->comment];
    712713}
    713714
    714715- (NSString *) creator
    715716{
    716     return fInfo->creator != NULL ? [NSString stringWithUTF8String: fInfo->creator] : @"";
     717    return [NSString stringWithUTF8String: fInfo->creator];
    717718}
    718719
     
    10861087- (NSString *) remainingTimeString
    10871088{
    1088     switch (fStat->status)
    1089     {
    1090         case TR_STATUS_DOWNLOAD:
    1091             return [self eta] >= 0 ? [self etaString: [self eta]] : NSLocalizedString(@"Unknown", "Torrent -> remaining time");
    1092        
    1093         case TR_STATUS_SEED:
    1094         case TR_STATUS_DONE:
    1095             return [NSLocalizedString(@"Ratio: ", "Torrent -> status string") stringByAppendingString:
    1096                                                                             [NSString stringForRatio: [self ratio]]];
    1097        
    1098         default:
    1099             return [self shortStatusString];
    1100     }
     1089    if (![self isActive] || ([self isSeeding]
     1090        && !(fRatioSetting == NSOnState || (fRatioSetting == NSMixedState && [fDefaults boolForKey: @"RatioCheck"]))))
     1091        return [self shortStatusString];
     1092   
     1093    int eta = fStat->status == TR_STATUS_DOWNLOAD ? [self eta] : [self etaRatio];
     1094    return eta >= 0 ? [self etaString: eta] : NSLocalizedString(@"Unknown", "Torrent -> remaining time");
    11011095}
    11021096
     
    15751569    fInfo = tr_torrentInfo(fHandle);
    15761570   
     1571    fNameString = [[NSString alloc] initWithUTF8String: fInfo->name];
    15771572    fHashString = [[NSString alloc] initWithUTF8String: fInfo->hashString];
    15781573   
     
    17131708        case TR_CP_COMPLETE:
    17141709            canMove = YES;
    1715        
     1710           
    17161711            //move file from incomplete folder to download folder
    17171712            if (fUseIncompleteFolder && ![[self downloadFolder] isEqualToString: fDownloadFolder]
Note: See TracChangeset for help on using the changeset viewer.