mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-29 20:07:38 +00:00
Added support for CF keys.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@26807 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
bfde86fcd5
commit
b79669d5f1
4 changed files with 57 additions and 8 deletions
|
@ -1849,7 +1849,14 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
}
|
||||
|
||||
iconPath = [[bundle infoDictionary] objectForKey: @"NSIcon"];
|
||||
|
||||
if(iconPath == nil)
|
||||
{
|
||||
/*
|
||||
* Try the CFBundleIconFile property.
|
||||
*/
|
||||
iconPath = [[bundle infoDictionary] objectForKey: @"CFBundleIconFile"];
|
||||
}
|
||||
|
||||
if (iconPath && [iconPath isAbsolutePath] == NO)
|
||||
{
|
||||
NSString *file = iconPath;
|
||||
|
@ -1875,7 +1882,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
* try 'wrapper/app.png'
|
||||
*/
|
||||
if (iconPath == nil)
|
||||
{
|
||||
{
|
||||
NSString *str;
|
||||
|
||||
str = [fullPath lastPathComponent];
|
||||
|
@ -1887,11 +1894,15 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
iconPath = [iconPath stringByAppendingPathExtension: @"tiff"];
|
||||
if ([mgr isReadableFileAtPath: iconPath] == NO)
|
||||
{
|
||||
iconPath = nil;
|
||||
iconPath = [iconPath stringByAppendingPathExtension: @"icns"];
|
||||
if ([mgr isReadableFileAtPath: iconPath] == NO)
|
||||
{
|
||||
iconPath = nil;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (iconPath != nil)
|
||||
{
|
||||
image = [self _saveImageFor: iconPath];
|
||||
|
@ -2042,6 +2053,11 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
NSDictionary *typeInfo = [extInfo objectForKey: appName];
|
||||
NSString *file = [typeInfo objectForKey: @"NSIcon"];
|
||||
|
||||
if(file == nil)
|
||||
{
|
||||
file = [typeInfo objectForKey: @"CFBundleTypeIconFile"];
|
||||
}
|
||||
|
||||
if (file && [file length] != 0)
|
||||
{
|
||||
if ([file isAbsolutePath] == NO)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue