get rid of duplicate address code, and display the tracker announce/scrape correctly

This commit is contained in:
Mitchell Livingston 2008-04-24 06:35:21 +00:00
parent 84515d4fb5
commit 59552d05e2
3 changed files with 4 additions and 12 deletions

View File

@ -1046,7 +1046,7 @@ typedef enum
Torrent * torrent = [fTorrents objectAtIndex: 0];
[fTrackerField setStringValue: [torrent trackerAddress]];
[fTrackerField setStringValue: [torrent trackerAddressAnnounce]];
NSString * location = [torrent dataLocation];
[fDataLocationField setStringValue: [location stringByAbbreviatingWithTildeInPath]];
@ -1129,7 +1129,7 @@ typedef enum
Torrent * torrent = [fTorrents objectAtIndex: 0];
//announce fields
NSString * announceAddress = [[torrent trackerAddress] stringByAppendingString: [torrent trackerAddressAnnounce]];
NSString * announceAddress = [torrent trackerAddressAnnounce];
[fAnnounceAddressField setStringValue: announceAddress];
[fAnnounceAddressField setToolTip: announceAddress];
@ -1144,10 +1144,9 @@ typedef enum
[fAnnounceNextField setStringValue: announceNext > 0 ? [NSString timeString: announceNext showSeconds: YES] : @""];
//scrape fields
NSString * scrapeAddressTail;
if ((scrapeAddressTail = [torrent trackerAddressScrape]))
NSString * scrapeAddress;
if ((scrapeAddress = [torrent trackerAddressScrape]))
{
NSString * scrapeAddress = [[torrent trackerAddress] stringByAppendingString: scrapeAddressTail];
[fScrapeAddressField setStringValue: scrapeAddress];
[fScrapeAddressField setToolTip: scrapeAddress];
}

View File

@ -139,7 +139,6 @@ typedef enum
- (uint64_t) size;
- (uint64_t) sizeLeft;
- (NSString *) trackerAddress;
- (NSString *) trackerAddressAnnounce;
- (NSDate *) lastAnnounceTime;
- (int) nextAnnounceTime;

View File

@ -718,12 +718,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
return fStat->leftUntilDone;
}
- (NSString *) trackerAddress
{
return [NSString stringWithUTF8String: fStat->tracker->announce];
}
#warning now redundant
- (NSString *) trackerAddressAnnounce
{
return [NSString stringWithUTF8String: fStat->tracker->announce];