diff --git a/ChangeLog b/ChangeLog index 2d80ffc3e..bdbcb254f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-23 22:17-EDT Gregory John Casamento + + * Source/NSWorkspace.m: Improve handling of CFBundleType... + constants in the private method _extIconForApp:info:. + 2009-05-23 11:48-EDT Gregory John Casamento * Source/GSStandardWindowDecorationView.m: Live window resize changes diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index 9846baae6..ecfd6f822 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -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)