if there is an error still display per-torrent speeds in the main window

This commit is contained in:
Mitchell Livingston 2007-09-30 13:22:15 +00:00
parent 3e87e07e0c
commit 6c962e15b1
1 changed files with 9 additions and 6 deletions

View File

@ -223,7 +223,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
fStat = tr_torrentStat(fHandle); fStat = tr_torrentStat(fHandle);
//check to stop for ratio //check to stop for ratio
#warning fix this!
float stopRatio; float stopRatio;
if ([self isSeeding] && (stopRatio = [self actualStopRatio]) != INVALID && [self ratio] >= stopRatio) if ([self isSeeding] && (stopRatio = [self actualStopRatio]) != INVALID && [self ratio] >= stopRatio)
{ {
@ -924,9 +923,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
else else
string = [NSString stringWithFormat: NSLocalizedString(@"Downloading from %d of 1 peer", string = [NSString stringWithFormat: NSLocalizedString(@"Downloading from %d of 1 peer",
"Torrent -> status string"), [self peersSendingToUs]]; "Torrent -> status string"), [self peersSendingToUs]];
string = [string stringByAppendingFormat: @" - DL: %@, UL: %@",
[NSString stringForSpeed: [self downloadRate]], [NSString stringForSpeed: [self uploadRate]]];
break; break;
case TR_STATUS_SEED: case TR_STATUS_SEED:
@ -937,8 +933,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
else else
string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"), string = [NSString stringWithFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"),
[self peersGettingFromUs]]; [self peersGettingFromUs]];
string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]];
break; break;
case TR_STATUS_STOPPING: case TR_STATUS_STOPPING:
@ -951,6 +945,15 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
if (fStalled) if (fStalled)
string = [NSLocalizedString(@"Stalled, ", "Torrent -> status string") stringByAppendingString: string]; string = [NSLocalizedString(@"Stalled, ", "Torrent -> status string") stringByAppendingString: string];
if ([self isActive] && ![self isChecking])
{
if (fStat->status == TR_STATUS_DOWNLOAD)
string = [string stringByAppendingFormat: @" - DL: %@, UL: %@",
[NSString stringForSpeed: [self downloadRate]], [NSString stringForSpeed: [self uploadRate]]];
else
string = [string stringByAppendingFormat: @" - UL: %@", [NSString stringForSpeed: [self uploadRate]]];
}
} }
return string; return string;