mirror of
https://github.com/transmission/transmission
synced 2024-12-27 01:57:52 +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;
|
badgeRect.origin.y += badgeBottomExtra;
|
||||||
|
|
||||||
//place badge text
|
//place badge text
|
||||||
[self badgeString: [NSString stringWithInt: fCompleted] forRect: badgeRect];
|
[self badgeString: [NSString stringWithFormat: @"%d", fCompleted] forRect: badgeRect];
|
||||||
|
|
||||||
[fDockIcon unlockFocus];
|
[fDockIcon unlockFocus];
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,9 +395,9 @@
|
||||||
Torrent * torrent = [fTorrents objectAtIndex: 0];
|
Torrent * torrent = [fTorrents objectAtIndex: 0];
|
||||||
|
|
||||||
int seeders = [torrent seeders], leechers = [torrent leechers], downloaded = [torrent completedFromTracker];
|
int seeders = [torrent seeders], leechers = [torrent leechers], downloaded = [torrent completedFromTracker];
|
||||||
[fSeedersField setStringValue: seeders < 0 ? @"" : [NSString stringWithInt: seeders]];
|
[fSeedersField setStringValue: seeders < 0 ? @"" : [NSString stringWithFormat: @"%d", seeders]];
|
||||||
[fLeechersField setStringValue: leechers < 0 ? @"" : [NSString stringWithInt: leechers]];
|
[fLeechersField setStringValue: leechers < 0 ? @"" : [NSString stringWithFormat: @"%d", leechers]];
|
||||||
[fCompletedFromTrackerField setStringValue: downloaded < 0 ? @"" : [NSString stringWithInt: downloaded]];
|
[fCompletedFromTrackerField setStringValue: downloaded < 0 ? @"" : [NSString stringWithFormat: @"%d", downloaded]];
|
||||||
|
|
||||||
BOOL active = [torrent isActive];
|
BOOL active = [torrent isActive];
|
||||||
|
|
||||||
|
@ -432,8 +432,8 @@
|
||||||
else
|
else
|
||||||
[fConnectedPeersField setStringValue: NSLocalizedString(@"info not available", "Inspector -> Peers tab -> peers")];
|
[fConnectedPeersField setStringValue: NSLocalizedString(@"info not available", "Inspector -> Peers tab -> peers")];
|
||||||
|
|
||||||
[fDownloadingFromField setStringValue: active ? [NSString stringWithInt: [torrent peersSendingToUs]] : @""];
|
[fDownloadingFromField setStringValue: active ? [NSString stringWithFormat: @"%d", [torrent peersSendingToUs]] : @""];
|
||||||
[fUploadingToField setStringValue: active ? [NSString stringWithInt: [torrent peersGettingFromUs]] : @""];
|
[fUploadingToField setStringValue: active ? [NSString stringWithFormat: @"%d", [torrent peersGettingFromUs]] : @""];
|
||||||
|
|
||||||
[fPeers release];
|
[fPeers release];
|
||||||
fPeers = [[[torrent peers] sortedArrayUsingDescriptors: [self peerSortDescriptors]] retain];
|
fPeers = [[[torrent peers] sortedArrayUsingDescriptors: [self peerSortDescriptors]] retain];
|
||||||
|
|
|
@ -29,8 +29,6 @@
|
||||||
+ (NSString *) ellipsis;
|
+ (NSString *) ellipsis;
|
||||||
- (NSString *) stringByAppendingEllipsis;
|
- (NSString *) stringByAppendingEllipsis;
|
||||||
|
|
||||||
+ (NSString *) stringWithInt: (int) value;
|
|
||||||
|
|
||||||
+ (NSString *) stringForFileSize: (uint64_t) size;
|
+ (NSString *) stringForFileSize: (uint64_t) size;
|
||||||
+ (NSString *) stringForSpeed: (float) speed;
|
+ (NSString *) stringForSpeed: (float) speed;
|
||||||
+ (NSString *) stringForSpeedAbbrev: (float) speed;
|
+ (NSString *) stringForSpeedAbbrev: (float) speed;
|
||||||
|
|
|
@ -37,11 +37,6 @@
|
||||||
return [self stringByAppendingString: [NSString ellipsis]];
|
return [self stringByAppendingString: [NSString ellipsis]];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (NSString *) stringWithInt: (int) value
|
|
||||||
{
|
|
||||||
return [NSString stringWithFormat: @"%d", value];
|
|
||||||
}
|
|
||||||
|
|
||||||
+ (NSString *) stringForFileSize: (uint64_t) size
|
+ (NSString *) stringForFileSize: (uint64_t) size
|
||||||
{
|
{
|
||||||
if (size < 1024)
|
if (size < 1024)
|
||||||
|
|
Loading…
Reference in a new issue