Changeset 855 for trunk/macosx/Torrent.m


Ignore:
Timestamp:
Sep 11, 2006, 11:52:03 PM (15 years ago)
Author:
livings124
Message:

Use tableView:objectValueForTableColumn:row: instead of tableView:willDisplayCell:...

This required passing in a dictionary of values to display, but should make it 10.5 compatible and potentially a little more efficient. Those using Leopard please report any issues, because I don't have it to test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r842 r855  
    272272}
    273273
     274- (NSDictionary *) infoForCurrentView
     275{
     276    NSMutableDictionary * info = [NSMutableDictionary dictionaryWithObjectsAndKeys:
     277                                    [self name], @"Name",
     278                                    [NSNumber numberWithBool: [self isSeeding]], @"Seeding",
     279                                    [NSNumber numberWithFloat: [self progress]], @"Progress",
     280                                    [NSNumber numberWithBool: [self isActive]], @"Active",
     281                                    [NSNumber numberWithBool: [self isError]], @"Error", nil];
     282   
     283    if (![fDefaults boolForKey: @"SmallView"])
     284    {
     285        [info setObject: fIconFlipped forKey: @"Icon"];
     286        [info setObject: [self progressString] forKey: @"ProgressString"];
     287        [info setObject: [self statusString] forKey: @"StatusString"];
     288    }
     289    else
     290    {
     291        [info setObject: fIconSmall forKey: @"Icon"];
     292        [info setObject: [self remainingTimeString] forKey: @"RemainingTimeString"];
     293        [info setObject: [self shortStatusString] forKey: @"ShortStatusString"];
     294    }
     295   
     296    return info;
     297}
     298
    274299- (void) startTransfer
    275300{
Note: See TracChangeset for help on using the changeset viewer.