show accurate number of total files

This commit is contained in:
Mitchell Livingston 2007-01-17 06:43:07 +00:00
parent b7e3c9af5a
commit 091aec4abe
4 changed files with 15 additions and 7 deletions

View File

@ -95,8 +95,10 @@
NSBrowserCell * browserCell = [[[NSBrowserCell alloc] init] autorelease];
[browserCell setLeaf: YES];
[[fFileOutline tableColumnWithIdentifier: @"Name"] setDataCell: browserCell];
[fFileOutline setDoubleAction: @selector(revealFile:)];
//set blank inspector
[self updateInfoForTorrents: [NSArray array]];
}
@ -263,13 +265,13 @@
[fFiles release];
fFiles = [[torrent fileList] retain];
#warning change!
if ([fFiles count] > 1)
[fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d files",
"Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
int fileCount = [torrent fileCount];
if (fileCount != 1)
[fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d files total",
"Inspector -> Files tab -> bottom text (number of files)"), fileCount]];
else
[fFileTableStatusField setStringValue: [NSString stringWithFormat: NSLocalizedString(@"%d file",
"Inspector -> Files tab -> bottom text (number of files)"), [fFiles count]]];
[fFileTableStatusField setStringValue: NSLocalizedString(@"1 file total",
"Inspector -> Files tab -> bottom text (number of files)")];
}
//update stats and settings

View File

@ -180,6 +180,7 @@
- (void) setOrderValue: (int) orderValue;
- (NSArray *) fileList;
- (int) fileCount;
- (NSDate *) date;
- (NSNumber *) stateSortKey;

View File

@ -1066,7 +1066,7 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
- (NSArray *) fileList
{
int count = fInfo->fileCount, i;
int count = [self fileCount], i;
tr_file_t file;
NSMutableArray * files = [NSMutableArray array];
@ -1082,6 +1082,11 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
return files;
}
- (int) fileCount
{
return fInfo->fileCount;
}
- (NSDate *) date
{
return fDate;