mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-25 04:47:55 +00:00
Fixed the icon-fetching method for configurations in which CFBundleIconFile has the icns extension in the value.
This commit is contained in:
1 parent
5aa1e18bc5
commit
c7b616ce1d
1 file changed
+9
-3
@@ -43,11 +43,17 @@
|
||||
{
|
||||
// Cache the application icon.
|
||||
NSString *iconPath = [self pathForResource:[self objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType:@"icns"];
|
||||
// According to the OS X docs, "CFBundleIconFile - This key identifies the file containing
|
||||
// the icon for the bundle. The filename you specify does not need to include the .icns
|
||||
// extension, although it may."
|
||||
//
|
||||
// However, if it *does* include the '.icns' the above method fails (tested on OS X 10.3.9) so we'll also try:
|
||||
if (!iconPath)
|
||||
iconPath = [self pathForResource:[self objectForInfoDictionaryKey:@"CFBundleIconFile"] ofType: nil];
|
||||
NSImage *icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
|
||||
if (icon)
|
||||
return icon;
|
||||
else // Use a default icon if none is defined.
|
||||
return [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericApplicationIcon)];
|
||||
return icon; else // Use a default icon if none is defined.
|
||||
return [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericApplicationIcon)];
|
||||
}
|
||||
|
||||
- (BOOL)isRunningFromDiskImage
|
||||
|
||||
Reference in new issue
Block a user