show tracker icons on 10.5

This commit is contained in:
Mitchell Livingston
2009-09-26 17:04:27 +00:00
parent c3b81a378c
commit 773cc64d7a
2 changed files with 10 additions and 5 deletions

View File

@@ -194,12 +194,10 @@ typedef enum
[self setWebSeedTableHidden: YES animate: NO];
if ([NSApp isOnSnowLeopardOrBetter])
{
fTrackerIconCache = [[NSCache alloc] init];
fTrackerIconLoading = [[NSMutableSet alloc] init];
}
else
[fTrackerTable removeTableColumn: [fTrackerTable tableColumnWithIdentifier: @"Icon"]];
fTrackerIconCacheLeopard = [[NSMutableDictionary alloc] init];
fTrackerIconLoading = [[NSMutableSet alloc] init];
//set blank inspector
[self setInfoForTorrents: [NSArray array]];
@@ -239,6 +237,7 @@ typedef enum
[fWebSeedTableAnimation release];
[fTrackerIconCache release];
[fTrackerIconCacheLeopard release];
[fTrackerIconLoading release];
[fPreviewPanel release];
@@ -909,7 +908,8 @@ typedef enum
else
baseAddress = [NSString stringWithFormat: @"http://%@", [hostComponents lastObject]];
id icon = [fTrackerIconCache objectForKey: baseAddress];
id icon = [NSApp isOnSnowLeopardOrBetter] ? [fTrackerIconCache objectForKey: baseAddress]
: [fTrackerIconCacheLeopard objectForKey: baseAddress];
if (!icon && ![fTrackerIconLoading containsObject: baseAddress])
{
[fTrackerIconLoading addObject: baseAddress];
@@ -940,10 +940,14 @@ typedef enum
if (icon)
{
[fTrackerIconCache setObject: icon forKey: baseAddress];
[fTrackerIconCacheLeopard setObject: icon forKey: baseAddress];
[icon release];
}
else
{
[fTrackerIconCache setObject: [NSNull null] forKey: baseAddress];
[fTrackerIconCacheLeopard setObject: [NSNull null] forKey: baseAddress];
}
[fTrackerIconLoading removeObject: baseAddress];