mirror of
https://github.com/transmission/transmission
synced 2024-12-26 09:37:56 +00:00
get rid of an unnecessry string additions method
This commit is contained in:
parent
47f1457d67
commit
52057e8c93
4 changed files with 6 additions and 13 deletions
|
@ -95,7 +95,7 @@
|
|||
badgeRect.origin.y += badgeBottomExtra;
|
||||
|
||||
//place badge text
|
||||
[self badgeString: [NSString stringWithInt: fCompleted] forRect: badgeRect];
|
||||
[self badgeString: [NSString stringWithFormat: @"%d", fCompleted] forRect: badgeRect];
|
||||
|
||||
[fDockIcon unlockFocus];
|
||||
}
|
||||
|
|
|
@ -395,9 +395,9 @@
|
|||
Torrent * torrent = [fTorrents objectAtIndex: 0];
|
||||
|
||||
int seeders = [torrent seeders], leechers = [torrent leechers], downloaded = [torrent completedFromTracker];
|
||||
[fSeedersField setStringValue: seeders < 0 ? @"" : [NSString stringWithInt: seeders]];
|
||||
[fLeechersField setStringValue: leechers < 0 ? @"" : [NSString stringWithInt: leechers]];
|
||||
[fCompletedFromTrackerField setStringValue: downloaded < 0 ? @"" : [NSString stringWithInt: downloaded]];
|
||||
[fSeedersField setStringValue: seeders < 0 ? @"" : [NSString stringWithFormat: @"%d", seeders]];
|
||||
[fLeechersField setStringValue: leechers < 0 ? @"" : [NSString stringWithFormat: @"%d", leechers]];
|
||||
[fCompletedFromTrackerField setStringValue: downloaded < 0 ? @"" : [NSString stringWithFormat: @"%d", downloaded]];
|
||||
|
||||
BOOL active = [torrent isActive];
|
||||
|
||||
|
@ -432,8 +432,8 @@
|
|||
else
|
||||
[fConnectedPeersField setStringValue: NSLocalizedString(@"info not available", "Inspector -> Peers tab -> peers")];
|
||||
|
||||
[fDownloadingFromField setStringValue: active ? [NSString stringWithInt: [torrent peersSendingToUs]] : @""];
|
||||
[fUploadingToField setStringValue: active ? [NSString stringWithInt: [torrent peersGettingFromUs]] : @""];
|
||||
[fDownloadingFromField setStringValue: active ? [NSString stringWithFormat: @"%d", [torrent peersSendingToUs]] : @""];
|
||||
[fUploadingToField setStringValue: active ? [NSString stringWithFormat: @"%d", [torrent peersGettingFromUs]] : @""];
|
||||
|
||||
[fPeers release];
|
||||
fPeers = [[[torrent peers] sortedArrayUsingDescriptors: [self peerSortDescriptors]] retain];
|
||||
|
|
|
@ -29,8 +29,6 @@
|
|||
+ (NSString *) ellipsis;
|
||||
- (NSString *) stringByAppendingEllipsis;
|
||||
|
||||
+ (NSString *) stringWithInt: (int) value;
|
||||
|
||||
+ (NSString *) stringForFileSize: (uint64_t) size;
|
||||
+ (NSString *) stringForSpeed: (float) speed;
|
||||
+ (NSString *) stringForSpeedAbbrev: (float) speed;
|
||||
|
|
|
@ -37,11 +37,6 @@
|
|||
return [self stringByAppendingString: [NSString ellipsis]];
|
||||
}
|
||||
|
||||
+ (NSString *) stringWithInt: (int) value
|
||||
{
|
||||
return [NSString stringWithFormat: @"%d", value];
|
||||
}
|
||||
|
||||
+ (NSString *) stringForFileSize: (uint64_t) size
|
||||
{
|
||||
if (size < 1024)
|
||||
|
|
Loading…
Reference in a new issue