mirror of
https://github.com/transmission/transmission
synced 2025-03-15 16:29:34 +00:00
avoid retaining tons of copies of the folder icon
This commit is contained in:
parent
a9e40db432
commit
1713e5ff88
3 changed files with 6 additions and 5 deletions
|
@ -29,9 +29,8 @@
|
|||
|
||||
@interface InfoWindowController : NSWindowController
|
||||
{
|
||||
NSArray * fTorrents;
|
||||
NSArray * fPeers, * fFiles;
|
||||
NSImage * fAppIcon, * fDotGreen, * fDotRed;
|
||||
NSArray * fTorrents, * fPeers, * fFiles;
|
||||
NSImage * fAppIcon, * fDotGreen, * fDotRed, * fFolderIcon;
|
||||
|
||||
IBOutlet NSTabView * fTabView;
|
||||
|
||||
|
|
|
@ -74,6 +74,8 @@
|
|||
fAppIcon = [[NSApp applicationIconImage] copy];
|
||||
fDotGreen = [NSImage imageNamed: @"GreenDot.tiff"];
|
||||
fDotRed = [NSImage imageNamed: @"RedDot.tiff"];
|
||||
|
||||
fFolderIcon = [[[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] copy];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -118,6 +120,7 @@
|
|||
[fFiles release];
|
||||
|
||||
[fAppIcon release];
|
||||
[fFolderIcon release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -715,7 +718,7 @@
|
|||
if (!item)
|
||||
return;
|
||||
|
||||
[cell setImage: [item objectForKey: @"Icon"]];
|
||||
[cell setImage: [[item objectForKey: @"IsFolder"] boolValue] ? fFolderIcon : [item objectForKey: @"Icon"]];
|
||||
}
|
||||
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: [NSNumber numberWithInt: 1] forKey: @"Remaining"];
|
||||
[dict setObject: [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')] forKey: @"Icon"];
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue