From 7cd4f7630d614869a3dc8592b04099080b3aaae7 Mon Sep 17 00:00:00 2001 From: CaS Date: Mon, 17 Jun 2002 15:03:58 +0000 Subject: [PATCH] Attempt to improve app location git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13902 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 4 ++++ Source/NSWorkspace.m | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 158fa016f..fa3353e8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-06-17 Richard Frith-Macdonald + + * Source/NSWorkspace.m: Vague attempt to improve locating of apps + 2002-06-15 Gregory John Casamento * Source/NSOutlineView.m a number of improvements: diff --git a/Source/NSWorkspace.m b/Source/NSWorkspace.m index 759b80202..bed3ca84c 100644 --- a/Source/NSWorkspace.m +++ b/Source/NSWorkspace.m @@ -506,9 +506,17 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath { NSString *ext = [appName pathExtension]; - if (ext == nil) + if ([ext length] == 0) { - appName = [appName stringByAppendingPathExtension: @"app"]; + appName = [last stringByAppendingPathExtension: @"app"]; + if ([applications objectForKey: appName] == nil) + { + appName = [last stringByAppendingPathExtension: @"debug"]; + if ([applications objectForKey: appName] == nil) + { + appName = [last stringByAppendingPathExtension: @"profile"]; + } + } } return [applications objectForKey: appName]; } @@ -1091,7 +1099,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath { NSString *path; - if (appName == nil) + if ([appName length] == 0) { return nil; } @@ -1102,14 +1110,10 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath path = [self fullPathForApplication: appName]; appName = [[path lastPathComponent] stringByDeletingPathExtension]; } - else if ([appName pathExtension] == nil) + else if ([[appName pathExtension] length] == 0) { path = [path stringByAppendingPathExtension: @"app"]; } - else - { - appName = [[path lastPathComponent] stringByDeletingPathExtension]; - } if (path == nil) {