trivial cleanup

This commit is contained in:
Mitchell Livingston 2008-04-07 03:54:23 +00:00
parent d40eaf6d97
commit 05ddd5f2ee
3 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@
convertedSize = size / 1048576.0;
unit = NSLocalizedString(@"MB", "File size - megabytes");
}
else if (size < 1099511627776.0)
else if (size < 1099511627776)
{
convertedSize = size / 1073741824.0;
unit = NSLocalizedString(@"GB", "File size - gigabytes");
@ -103,7 +103,7 @@
else if (ratio <= 99.95) //10.0 to 99.9
return [NSString localizedStringWithFormat: @"%.1f", ratio];
else //rest are single digit
return [NSString stringWithFormat: @"%.0f", ratio];
return [NSString localizedStringWithFormat: @"%.0f", ratio];
}
+ (NSString *) timeString: (uint64_t) seconds showSeconds: (BOOL) showSeconds

View File

@ -1849,9 +1849,10 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
{
//attempt to move to trash
if (![[NSWorkspace sharedWorkspace] performFileOperation: NSWorkspaceRecycleOperation
source: [path stringByDeletingLastPathComponent] destination: @""
files: [NSArray arrayWithObject: [path lastPathComponent]] tag: nil])
source: [path stringByDeletingLastPathComponent] destination: @""
files: [NSArray arrayWithObject: [path lastPathComponent]] tag: nil])
{
//if cannot trash, just delete it (will work if it's on a remote volume)
if ([NSApp isOnLeopardOrBetter])
{
NSError * error;
@ -1860,7 +1861,6 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
}
else
{
//if cannot trash, just delete it (will work if it is on a remote volume)
if (![[NSFileManager defaultManager] removeFileAtPath: path handler: nil])
NSLog(@"Could not trash %@", path);
}