Changeset 9209


Ignore:
Timestamp:
Sep 28, 2009, 2:13:20 PM (13 years ago)
Author:
livings124
Message:

don't use a NSCache until we go 10.6-only

Location:
trunk/macosx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TrackerCell.m

    r9208 r9209  
    5252
    5353//make the favicons accessible to all tracker cells
    54 NSCache * fTrackerIconCache;
    55 NSMutableDictionary * fTrackerIconCacheLeopard;
     54#warning make NSCache when 10.6-only
     55NSMutableDictionary * fTrackerIconCache;
    5656NSMutableSet * fTrackerIconLoading;
    5757
    5858+ (void) initialize
    5959{
    60     if ([NSApp isOnSnowLeopardOrBetter])
    61         fTrackerIconCache = [[NSCache alloc] init];
    62     else
    63         fTrackerIconCacheLeopard = [[NSMutableDictionary alloc] init];
     60    fTrackerIconCache = [[NSMutableDictionary alloc] init];
    6461    fTrackerIconLoading = [[NSMutableSet alloc] init];
    6562}
     
    165162        baseAddress = [NSString stringWithFormat: @"http://%@", [hostComponents lastObject]];
    166163   
    167     id icon = [NSApp isOnSnowLeopardOrBetter] ? [fTrackerIconCache objectForKey: baseAddress]
    168                                             : [fTrackerIconCacheLeopard objectForKey: baseAddress];
     164    id icon = [fTrackerIconCache objectForKey: baseAddress];
    169165    if (!icon && ![fTrackerIconLoading containsObject: baseAddress])
    170166    {
     
    189185    if (icon)
    190186    {
    191         [NSApp isOnSnowLeopardOrBetter] ? [fTrackerIconCache setObject: icon forKey: baseAddress]
    192                                         : [fTrackerIconCacheLeopard setObject: icon forKey: baseAddress];
     187        [fTrackerIconCache setObject: icon forKey: baseAddress];
    193188        [icon release];
    194189    }
    195190    else
    196     {
    197         [NSApp isOnSnowLeopardOrBetter] ? [fTrackerIconCache setObject: [NSNull null] forKey: baseAddress]
    198                                         : [fTrackerIconCacheLeopard setObject: [NSNull null] forKey: baseAddress];
    199     }
     191        [fTrackerIconCache setObject: [NSNull null] forKey: baseAddress];
    200192   
    201193    [fTrackerIconLoading removeObject: baseAddress];
  • trunk/macosx/TrackerNode.h

    r9203 r9209  
    3636- (NSString *) fullAnnounceAddress;
    3737
     38- (NSInteger) totalSeeders;
     39- (NSInteger) totalLeechers;
     40- (NSInteger) totalDownloaded;
     41
    3842- (NSString *) lastAnnounceStatusString;
    3943- (NSString *) nextAnnounceStatusString;
  • trunk/macosx/TrackerNode.m

    r9203 r9209  
    5353{
    5454    return [NSString stringWithUTF8String: fStat.announce];
     55}
     56
     57- (NSInteger) totalSeeders
     58{
     59    return fStat.seederCount;
     60}
     61
     62- (NSInteger) totalLeechers
     63{
     64    return fStat.leecherCount;
     65}
     66
     67- (NSInteger) totalDownloaded
     68{
     69    return fStat.downloadCount;
    5570}
    5671
Note: See TracChangeset for help on using the changeset viewer.