Ignore:
Timestamp:
Sep 28, 2007, 1:42:28 PM (15 years ago)
Author:
livings124
Message:

combine some progress string code and release an attributes dictionary when it's not needed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r3212 r3216  
    955955                    string = [NSString stringWithFormat: NSLocalizedString(@"Downloading from %d of 1 peer",
    956956                                                    "Torrent -> status string"), [self peersSendingToUs]];
     957               
     958                string = [string stringByAppendingFormat: @" - DL: %@, UL: %@",
     959                            [NSString stringForSpeed: [self downloadRate]], [NSString stringForSpeed: [self uploadRate]]];
    957960                break;
    958961
     
    965968                    string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"),
    966969                                                    [self peersGettingFromUs]];
     970                   
     971               
     972                string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]];
    967973                break;
    968974
     
    977983        if (fStalled)
    978984            string = [NSLocalizedString(@"Stalled, ", "Torrent -> status string") stringByAppendingString: string];
    979     }
    980    
    981     if ([self isActive] && ![self isChecking])
    982     {
    983         NSString * stringToAppend;
    984         if (![self allDownloaded])
    985             stringToAppend = [NSString stringWithFormat: NSLocalizedString(@"DL: %@, ", "Torrent -> status string"),
    986                                 [NSString stringForSpeed: [self downloadRate]]];
    987         else
    988             stringToAppend = @"";
    989        
    990         string = [string stringByAppendingFormat: @" - %@UL: %@", stringToAppend, [NSString stringForSpeed: [self uploadRate]]];
    991985    }
    992986   
Note: See TracChangeset for help on using the changeset viewer.