avoid retaining tons of copies of the folder icon
This commit is contained in:
parent
a9e40db432
commit
1713e5ff88
|
@ -29,9 +29,8 @@
|
||||||
|
|
||||||
@interface InfoWindowController : NSWindowController
|
@interface InfoWindowController : NSWindowController
|
||||||
{
|
{
|
||||||
NSArray * fTorrents;
|
NSArray * fTorrents, * fPeers, * fFiles;
|
||||||
NSArray * fPeers, * fFiles;
|
NSImage * fAppIcon, * fDotGreen, * fDotRed, * fFolderIcon;
|
||||||
NSImage * fAppIcon, * fDotGreen, * fDotRed;
|
|
||||||
|
|
||||||
IBOutlet NSTabView * fTabView;
|
IBOutlet NSTabView * fTabView;
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,8 @@
|
||||||
fAppIcon = [[NSApp applicationIconImage] copy];
|
fAppIcon = [[NSApp applicationIconImage] copy];
|
||||||
fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
|
fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
|
||||||
fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
|
fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
|
||||||
|
|
||||||
|
fFolderIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] copy];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
@ -118,6 +120,7 @@
|
||||||
[fFiles release];
|
[fFiles release];
|
||||||
|
|
||||||
[fAppIcon release];
|
[fAppIcon release];
|
||||||
|
[fFolderIcon release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,7 +718,7 @@
|
||||||
if (!item)
|
if (!item)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
[cell setImage: [item objectForKey: @"Icon"]];
|
[cell setImage: [[item objectForKey: @"IsFolder"] boolValue] ? fFolderIcon : [item objectForKey: @"Icon"]];
|
||||||
}
|
}
|
||||||
else if ([[tableColumn identifier] isEqualToString: @"Check"])
|
else if ([[tableColumn identifier] isEqualToString: @"Check"])
|
||||||
{
|
{
|
||||||
|
|
|
@ -1334,7 +1334,6 @@ static uint32_t kRed = BE(0xFF6450FF), //255, 100, 80
|
||||||
{
|
{
|
||||||
[dict setObject: [NSMutableArray array] forKey: @"Children"];
|
[dict setObject: [NSMutableArray array] forKey: @"Children"];
|
||||||
[dict setObject: [NSNumber numberWithInt: 1] forKey: @"Remaining"];
|
[dict setObject: [NSNumber numberWithInt: 1] forKey: @"Remaining"];
|
||||||
[dict setObject: [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] forKey: @"Icon"];
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue