Add individual file sizes to info's file table.
This commit is contained in:
parent
8bc4cefa2d
commit
a99e6ab33a
Binary file not shown.
|
@ -469,11 +469,13 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
NSString * file = [fFiles objectAtIndex: row];
|
||||
NSDictionary * file = [fFiles objectAtIndex: row];
|
||||
if ([ident isEqualToString: @"Icon"])
|
||||
return [[NSWorkspace sharedWorkspace] iconForFileType: [file pathExtension]];
|
||||
return [[NSWorkspace sharedWorkspace] iconForFileType: [[file objectForKey: @"Name"] pathExtension]];
|
||||
else if ([ident isEqualToString: @"Size"])
|
||||
return [NSString stringForFileSize: [[file objectForKey: @"Size"] unsignedIntValue]];
|
||||
else
|
||||
return [file lastPathComponent];
|
||||
return [[file objectForKey: @"Name"] lastPathComponent];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -496,7 +498,7 @@
|
|||
rect: (NSRectPointer) rect tableColumn: (NSTableColumn *) column
|
||||
row: (int) row mouseLocation: (NSPoint) mouseLocation
|
||||
{
|
||||
return tableView == fFileTable ? [fFiles objectAtIndex: row] : nil;
|
||||
return tableView == fFileTable ? [[fFiles objectAtIndex: row] objectForKey: @"Name"] : nil;
|
||||
}
|
||||
|
||||
- (NSArray *) peerSortDescriptors
|
||||
|
|
|
@ -630,10 +630,17 @@
|
|||
- (NSArray *) fileList
|
||||
{
|
||||
int count = fInfo->fileCount, i;
|
||||
tr_file_t file;
|
||||
NSMutableArray * files = [NSMutableArray arrayWithCapacity: count];
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
[files addObject: [[self downloadFolder] stringByAppendingPathComponent:
|
||||
[NSString stringWithUTF8String: fInfo->files[i].name]]];
|
||||
{
|
||||
file = fInfo->files[i];
|
||||
[files addObject: [NSDictionary dictionaryWithObjectsAndKeys: [[self downloadFolder]
|
||||
stringByAppendingPathComponent: [NSString stringWithUTF8String: file.name]], @"Name",
|
||||
[NSNumber numberWithUnsignedInt: file.length], @"Size", nil]];
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue