Changeset 799


Ignore:
Timestamp:
Aug 20, 2006, 6:32:55 PM (15 years ago)
Author:
livings124
Message:

Add individual file sizes to info's file table.

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/InfoWindowController.m

    r797 r799  
    470470    else
    471471    {
    472         NSString * file = [fFiles objectAtIndex: row];
     472        NSDictionary * file = [fFiles objectAtIndex: row];
    473473        if ([ident isEqualToString: @"Icon"])
    474             return [[NSWorkspace sharedWorkspace] iconForFileType: [file pathExtension]];
     474            return [[NSWorkspace sharedWorkspace] iconForFileType: [[file objectForKey: @"Name"] pathExtension]];
     475        else if ([ident isEqualToString: @"Size"])
     476            return [NSString stringForFileSize: [[file objectForKey: @"Size"] unsignedIntValue]];
    475477        else
    476             return [file lastPathComponent];
     478            return [[file objectForKey: @"Name"] lastPathComponent];
    477479    }
    478480}
     
    497499        row: (int) row mouseLocation: (NSPoint) mouseLocation
    498500{
    499     return tableView == fFileTable ? [fFiles objectAtIndex: row] : nil;
     501    return tableView == fFileTable ? [[fFiles objectAtIndex: row] objectForKey: @"Name"] : nil;
    500502}
    501503
  • trunk/macosx/Torrent.m

    r789 r799  
    631631{
    632632    int count = fInfo->fileCount, i;
     633    tr_file_t file;
    633634    NSMutableArray * files = [NSMutableArray arrayWithCapacity: count];
     635   
    634636    for (i = 0; i < count; i++)
    635         [files addObject: [[self downloadFolder] stringByAppendingPathComponent:
    636             [NSString stringWithUTF8String: fInfo->files[i].name]]];
     637    {
     638        file = fInfo->files[i];
     639        [files addObject: [NSDictionary dictionaryWithObjectsAndKeys: [[self downloadFolder]
     640            stringByAppendingPathComponent: [NSString stringWithUTF8String: file.name]], @"Name",
     641            [NSNumber numberWithUnsignedInt: file.length], @"Size", nil]];
     642    }
     643   
    637644    return files;
    638645}
Note: See TracChangeset for help on using the changeset viewer.