From 42bcba5853ade12c07fe63f9af7f3c974338b45f Mon Sep 17 00:00:00 2001 From: Mitchell Livingston Date: Sun, 15 Jul 2007 17:25:06 +0000 Subject: [PATCH] use peersConnected instead of peersTotal --- macosx/InfoWindowController.m | 2 +- macosx/Torrent.h | 2 +- macosx/Torrent.m | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index c0eac9107..78fa11009 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -403,7 +403,7 @@ if (active) { - int total = [torrent totalPeers]; + int total = [torrent totalPeersConnected]; NSString * connected = [NSString stringWithFormat: NSLocalizedString(@"%d Connected", "Inspector -> Peers tab -> peers"), total]; diff --git a/macosx/Torrent.h b/macosx/Torrent.h index 3acb63fa4..4218af59a 100644 --- a/macosx/Torrent.h +++ b/macosx/Torrent.h @@ -177,7 +177,7 @@ - (int) leechers; - (int) completedFromTracker; -- (int) totalPeers; +- (int) totalPeersConnected; - (int) totalPeersTracker; - (int) totalPeersIncoming; - (int) totalPeersCache; diff --git a/macosx/Torrent.m b/macosx/Torrent.m index b1591c4b1..3cdc2a753 100644 --- a/macosx/Torrent.m +++ b/macosx/Torrent.m @@ -379,9 +379,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 case TR_STATUS_DOWNLOAD: [statusString setString: @""]; - if ([self totalPeers] != 1) + if ([self totalPeersConnected] != 1) [statusString appendFormat: NSLocalizedString(@"Downloading from %d of %d peers", - "Torrent -> status string"), [self peersUploading], [self totalPeers]]; + "Torrent -> status string"), [self peersUploading], [self totalPeersConnected]]; else [statusString appendFormat: NSLocalizedString(@"Downloading from %d of 1 peer", "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_DONE: [statusString setString: @""]; - if ([self totalPeers] != 1) + if ([self totalPeersConnected] != 1) [statusString appendFormat: NSLocalizedString(@"Seeding to %d of %d peers", "Torrent -> status string"), - [self peersDownloading], [self totalPeers]]; + [self peersDownloading], [self totalPeersConnected]]; else [statusString appendFormat: NSLocalizedString(@"Seeding to %d of 1 peer", "Torrent -> status string"), [self peersDownloading]]; @@ -1107,7 +1107,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 - (NSArray *) peers { 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]; NSMutableDictionary * dic; @@ -1180,9 +1180,9 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 return fStat->completedFromTracker; } -- (int) totalPeers +- (int) totalPeersConnected { - return fStat->peersTotal; + return fStat->peersConnected; } - (int) totalPeersTracker @@ -1779,7 +1779,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80 //determine percentage finished and available 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; else {