mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 02:10:48 +00:00
mprove handling of Info.plist
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4074 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
425fe89709
commit
f77ae12819
1 changed files with 20 additions and 3 deletions
|
@ -426,6 +426,7 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
|||
showIcon: (BOOL)showIcon
|
||||
autolaunch: (BOOL)autolaunch
|
||||
{
|
||||
NSFileManager *mgr;
|
||||
NSString *path;
|
||||
NSString *file;
|
||||
NSDictionary *info;
|
||||
|
@ -459,14 +460,30 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
|||
* replace the path with that specified.
|
||||
*/
|
||||
file = [path stringByAppendingPathComponent: @"Resources/Info-gnustep.plist"];
|
||||
info = [NSDictionary dictionaryWithContentsOfFile: file];
|
||||
mgr = [NSFileManager defaultManager];
|
||||
if ([mgr isReadableFileAtPath: file])
|
||||
info = [NSDictionary dictionaryWithContentsOfFile: file];
|
||||
else
|
||||
{
|
||||
file = [path stringByAppendingPathComponent: @"Resources/Info.plist"];
|
||||
if ([mgr isReadableFileAtPath: file])
|
||||
info = [NSDictionary dictionaryWithContentsOfFile: file];
|
||||
else
|
||||
info = nil;
|
||||
}
|
||||
file = [info objectForKey: @"NSExecutable"];
|
||||
if (file != nil)
|
||||
{
|
||||
NSString *exepath;
|
||||
|
||||
appName = [file lastPathComponent];
|
||||
if ([file isAbsolutePath] == YES)
|
||||
exepath = [file stringByDeletingLastPathComponent];
|
||||
if ([exepath isEqualToString: @""] == NO)
|
||||
{
|
||||
path = [file stringByDeletingLastPathComponent];
|
||||
if ([file isAbsolutePath] == YES)
|
||||
path = exepath;
|
||||
else
|
||||
path = [path stringByAppendingPathComponent: exepath];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue