Apparently with iTunes 10.6.3 on Mac OS X 10.6.8, the NSIconRefImageRep that is returned by -iconfForFile: for iTunes fails to encode itself for NSCopying. As a workaround, convert it to TIFF and back before using it. adium-1.5.3
authorThijs Alkemade <thijsalkemade@gmail.com>
Sat, 21 Jul 2012 23:09:34 +0200
branchadium-1.5.3
changeset 4892635d3c31c55d
parent 4891 3a4f8cd9af0d
child 4897 5ea3bd51010d
Apparently with iTunes 10.6.3 on Mac OS X 10.6.8, the NSIconRefImageRep that is returned by -iconfForFile: for iTunes fails to encode itself for NSCopying. As a workaround, convert it to TIFF and back before using it.

Fixes #16046
Source/ESiTunesPlugin.m
     1.1 --- a/Source/ESiTunesPlugin.m	Sat Jul 21 15:46:26 2012 +0200
     1.2 +++ b/Source/ESiTunesPlugin.m	Sat Jul 21 23:09:34 2012 +0200
     1.3 @@ -558,7 +558,14 @@
     1.4  	MVMenuButton  *button = [[MVMenuButton alloc] initWithFrame:NSMakeRect(0,0,32,32)];
     1.5  
     1.6  	//configure the popup button and its menu
     1.7 -	[button setImage:[[NSWorkspace sharedWorkspace] iconForFile:iTunesPath]];
     1.8 +
     1.9 +    /* XXX Remove after 10.6: Apparently with iTunes 10.6.3 on Mac OS X 10.6.8, the NSIconRefImageRep
    1.10 +     * that is returned by -iconfForFile: for iTunes fails to encode itself for NSCopying. Make a copy
    1.11 +     * here via -TIFFRepresentation to avoid this bug.
    1.12 +     * rdar://11930126 http://trac.adium.im/ticket/16046
    1.13 +     */
    1.14 +    NSData *imageData = [[[NSWorkspace sharedWorkspace] iconForFile:iTunesPath] TIFFRepresentation];
    1.15 +	[button setImage:[[[NSImage alloc] initWithData:imageData] autorelease]];
    1.16  	[self createiTunesToolbarItemMenuItems:menu];
    1.17  
    1.18  	NSToolbarItem * iTunesItem = [AIToolbarUtilities toolbarItemWithIdentifier:KEY_TRIGGERS_TOOLBAR