* Source/NSWorkspace.m: Improve handling of CFBundleType...

constants in the private method _extIconForApp:info:.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28297 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
gcasa 2009-05-24 02:17:05 +00:00
parent e42b695869
commit be86a40839
2 changed files with 26 additions and 2 deletions

View file

@ -2136,10 +2136,29 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
{
NSDictionary *typeInfo = [extInfo objectForKey: appName];
NSString *file = [typeInfo objectForKey: @"NSIcon"];
//
// If the NSIcon entry isn't there and the CFBundle entries are,
// get the first icon in the list if it's an array, or assign
// the icon to file if it's a string.
//
// FIXME: CFBundleTypeExtensions/IconFile can be arrays which assign
// multiple types to icons. This needs to be handled eventually.
//
if(file == nil)
{
file = [typeInfo objectForKey: @"CFBundleTypeIconFile"];
id icon = [typeInfo objectForKey: @"CFBundleTypeIconFile"];
if([icon isKindOfClass: [NSArray class]])
{
if([icon count])
{
file = [icon objectAtIndex: 0];
}
}
else
{
file = icon;
}
}
if (file && [file length] != 0)