use peersConnected instead of peersTotal

This commit is contained in:
Mitchell Livingston 2007-07-15 17:25:06 +00:00
parent 73ca83a455
commit 42bcba5853
3 changed files with 10 additions and 10 deletions

View File

@ -403,7 +403,7 @@
if (active) if (active)
{ {
int total = [torrent totalPeers]; int total = [torrent totalPeersConnected];
NSString * connected = [NSString stringWithFormat: NSString * connected = [NSString stringWithFormat:
NSLocalizedString(@"%d Connected", "Inspector -> Peers tab -> peers"), total]; NSLocalizedString(@"%d Connected", "Inspector -> Peers tab -> peers"), total];

View File

@ -177,7 +177,7 @@
- (int) leechers; - (int) leechers;
- (int) completedFromTracker; - (int) completedFromTracker;
- (int) totalPeers; - (int) totalPeersConnected;
- (int) totalPeersTracker; - (int) totalPeersTracker;
- (int) totalPeersIncoming; - (int) totalPeersIncoming;
- (int) totalPeersCache; - (int) totalPeersCache;

View File

@ -379,9 +379,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
case TR_STATUS_DOWNLOAD: case TR_STATUS_DOWNLOAD:
[statusString setString: @""]; [statusString setString: @""];
if ([self totalPeers] != 1) if ([self totalPeersConnected] != 1)
[statusString appendFormat: NSLocalizedString(@"Downloading from %d of %d peers", [statusString appendFormat: NSLocalizedString(@"Downloading from %d of %d peers",
"Torrent -> status string"), [self peersUploading], [self totalPeers]]; "Torrent -> status string"), [self peersUploading], [self totalPeersConnected]];
else else
[statusString appendFormat: NSLocalizedString(@"Downloading from %d of 1 peer", [statusString appendFormat: NSLocalizedString(@"Downloading from %d of 1 peer",
"Torrent -> status string"), [self peersUploading]]; "Torrent -> status string"), [self peersUploading]];
@ -422,9 +422,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
case TR_STATUS_SEED: case TR_STATUS_SEED:
case TR_STATUS_DONE: case TR_STATUS_DONE:
[statusString setString: @""]; [statusString setString: @""];
if ([self totalPeers] != 1) if ([self totalPeersConnected] != 1)
[statusString appendFormat: NSLocalizedString(@"Seeding to %d of %d peers", "Torrent -> status string"), [statusString appendFormat: NSLocalizedString(@"Seeding to %d of %d peers", "Torrent -> status string"),
[self peersDownloading], [self totalPeers]]; [self peersDownloading], [self totalPeersConnected]];
else else
[statusString appendFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"), [statusString appendFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"),
[self peersDownloading]]; [self peersDownloading]];
@ -1107,7 +1107,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
- (NSArray *) peers - (NSArray *) peers
{ {
int totalPeers, i; int totalPeers, i;
tr_peer_stat_t * peers = tr_torrentPeers(fHandle, & totalPeers); tr_peer_stat_t * peers = tr_torrentPeers(fHandle, &totalPeers);
NSMutableArray * peerDics = [NSMutableArray arrayWithCapacity: totalPeers]; NSMutableArray * peerDics = [NSMutableArray arrayWithCapacity: totalPeers];
NSMutableDictionary * dic; NSMutableDictionary * dic;
@ -1180,9 +1180,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return fStat->completedFromTracker; return fStat->completedFromTracker;
} }
- (int) totalPeers - (int) totalPeersConnected
{ {
return fStat->peersTotal; return fStat->peersConnected;
} }
- (int) totalPeersTracker - (int) totalPeersTracker
@ -1779,7 +1779,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
//determine percentage finished and available //determine percentage finished and available
int have = rintf((float)MAX_PIECES * [self progress]), avail; int have = rintf((float)MAX_PIECES * [self progress]), avail;
if ([self progress] >= 1.0 || ![self isActive] || [self totalPeers] <= 0) if ([self progress] >= 1.0 || ![self isActive] || [self totalPeersConnected] <= 0)
avail = 0; avail = 0;
else else
{ {