mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
combine some progress string code and release an attributes dictionary when it's not needed
This commit is contained in:
parent
dc7a374fb3
commit
2ac0980ea5
2 changed files with 13 additions and 12 deletions
|
@ -48,6 +48,13 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
//attributes not needed anymore
|
||||
if (fAttributes)
|
||||
{
|
||||
[fAttributes release];
|
||||
fAttributes = nil;
|
||||
}
|
||||
|
||||
[super drawWithFrame: cellFrame inView: controlView];
|
||||
if ([self floatValue] >= 1.0)
|
||||
{
|
||||
|
|
|
@ -954,6 +954,9 @@ static int static_lastid = 0;
|
|||
else
|
||||
string = [NSString stringWithFormat: NSLocalizedString(@"Downloading from %d of 1 peer",
|
||||
"Torrent -> status string"), [self peersSendingToUs]];
|
||||
|
||||
string = [string stringByAppendingFormat: @" - DL: %@, UL: %@",
|
||||
[NSString stringForSpeed: [self downloadRate]], [NSString stringForSpeed: [self uploadRate]]];
|
||||
break;
|
||||
|
||||
case TR_STATUS_SEED:
|
||||
|
@ -964,6 +967,9 @@ static int static_lastid = 0;
|
|||
else
|
||||
string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"),
|
||||
[self peersGettingFromUs]];
|
||||
|
||||
|
||||
string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]];
|
||||
break;
|
||||
|
||||
case TR_STATUS_STOPPING:
|
||||
|
@ -978,18 +984,6 @@ static int static_lastid = 0;
|
|||
string = [NSLocalizedString(@"Stalled, ", "Torrent -> status string") stringByAppendingString: string];
|
||||
}
|
||||
|
||||
if ([self isActive] && ![self isChecking])
|
||||
{
|
||||
NSString * stringToAppend;
|
||||
if (![self allDownloaded])
|
||||
stringToAppend = [NSString stringWithFormat: NSLocalizedString(@"DL: %@, ", "Torrent -> status string"),
|
||||
[NSString stringForSpeed: [self downloadRate]]];
|
||||
else
|
||||
stringToAppend = @"";
|
||||
|
||||
string = [string stringByAppendingFormat: @" - %@UL: %@", stringToAppend, [NSString stringForSpeed: [self uploadRate]]];
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue