mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 12:28:52 +00:00
avoid retaining tons of copies of the folder icon
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user