Changeset 2276


Ignore:
Timestamp:
Jul 3, 2007, 1:49:21 AM (15 years ago)
Author:
livings124
Message:

create the display icon of torrents when needed (so if you only use minimal or regular view, it won't create the other icon)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Torrent.m

    r2275 r2276  
    532532    if (![fDefaults boolForKey: @"SmallView"])
    533533    {
    534         [info setObject: fIconFlipped forKey: @"Icon"];
     534        [info setObject: [self iconFlipped] forKey: @"Icon"];
    535535        [info setObject: [self progressString] forKey: @"ProgressString"];
    536536        [info setObject: [self statusString] forKey: @"StatusString"];
     
    538538    else
    539539    {
    540         [info setObject: fIconSmall forKey: @"Icon"];
     540        [info setObject: [self iconSmall] forKey: @"Icon"];
    541541        [info setObject: [self remainingTimeString] forKey: @"RemainingTimeString"];
    542542        [info setObject: [self shortStatusString] forKey: @"ShortStatusString"];
     
    936936- (NSImage *) iconFlipped
    937937{
     938    if (!fIconFlipped)
     939    {
     940        fIconFlipped = [fIcon copy];
     941        [fIconFlipped setFlipped: YES];
     942    }
    938943    return fIconFlipped;
    939944}
     
    941946- (NSImage *) iconSmall
    942947{
     948    if (!fIconSmall)
     949    {
     950        fIconSmall = [fIcon copy];
     951        [fIconSmall setFlipped: YES];
     952        [fIconSmall setScalesWhenResized: YES];
     953        [fIconSmall setSize: NSMakeSize(16.0, 16.0)];
     954    }
    943955    return fIconSmall;
    944956}
     
    15621574    fIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: fInfo->multifile ? NSFileTypeForHFSTypeCode('fldr')
    15631575                                                : [[self name] pathExtension]] retain];
    1564    
    1565     fIconFlipped = [fIcon copy];
    1566     [fIconFlipped setFlipped: YES];
    1567    
    1568     fIconSmall = [fIconFlipped copy];
    1569     [fIconSmall setScalesWhenResized: YES];
    1570     [fIconSmall setSize: NSMakeSize(16.0, 16.0)];
    15711576
    15721577    fProgressString = [[NSMutableString alloc] initWithCapacity: 50];
Note: See TracChangeset for help on using the changeset viewer.