From 05b4abb11cb0a1d2e5d49d30049c20334528a8e0 Mon Sep 17 00:00:00 2001 From: helge Date: Tue, 1 Mar 2005 20:26:34 +0000 Subject: [PATCH] fixed bundle resource lookup on MacOSX, changed resource lookup in NGBundleManager git-svn-id: http://svn.opengroupware.org/SOPE/trunk@606 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-appserver/NGObjWeb/ChangeLog | 5 +++++ .../SoObjects/SoProductResourceManager.m | 7 ++++--- sope-appserver/NGObjWeb/Version | 1 + sope-core/NGExtensions/ChangeLog | 7 +++++++ sope-core/NGExtensions/NGBundleManager.m | 20 +++++++++++++------ sope-core/NGExtensions/Version | 2 +- 6 files changed, 32 insertions(+), 10 deletions(-) diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 0262b3e4..56bb7fa8 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,8 @@ +2005-03-01 Helge Hess + + * SoObjects/SoProductResourceManager.m: fixed to use the changed lookup + in NGBundleManager.m (v4.5.122) + 2005-02-25 Marcus Mueller * WOResourceManager.m: Fixed condition in -resourcesPathForFramework:, diff --git a/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m b/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m index ca1fefe7..3ac49bf9 100644 --- a/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m +++ b/sope-appserver/NGObjWeb/SoObjects/SoProductResourceManager.m @@ -145,11 +145,11 @@ static BOOL debugOn = NO; path = [[self->product bundle] pathForResource:[_name stringByDeletingPathExtension] ofType:[_name pathExtension] - inDirectory:@"Resources" + inDirectory:nil languages:_l]; if (debugOn && path == nil) { - [self debugWithFormat:@" resource %@/%@ not found.", - _name, [_l componentsJoinedByString:@","]]; + [self debugWithFormat:@" resource %@/%@ not found in bundle: %@", + _name, [_l componentsJoinedByString:@","], [self->product bundle]]; } return path; } @@ -281,6 +281,7 @@ static BOOL debugOn = NO; resource = [self primaryLookupPathForResourceNamed:_name languages:_languages]; + if (debugOn) [self debugWithFormat:@" resource: %@", resource]; resource = [self fixupResourcePath:resource]; if (debugOn) [self debugWithFormat:@" resource to URL: %@", resource]; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 8f914dd5..0a0b337c 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -2,6 +2,7 @@ SUBMINOR_VERSION:=121 +# v4.5.122 requires libNGExtensions v4.5.153 # v4.5.91 requires libNGExtensions v4.5.134 # v4.5.84 requires libNGExtensions v4.5.127 # v4.3.42 requires libNGExtensions v4.3.116 diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index b7472a9f..183b935c 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,10 @@ +2005-03-01 Helge Hess + + * NGBundleManager.m (-pathForResource:ofType:inDirectory:languages:): + changed resource lookup to look in Contents/Resources or Resources + depending on the Foundaiton library when no inDirectory: has been + given (v4.5.153) + 2005-02-23 Helge Hess * FdExt.subproj/NSNull+misc.m: added -hasPrefix: / -hasSuffix:, should diff --git a/sope-core/NGExtensions/NGBundleManager.m b/sope-core/NGExtensions/NGBundleManager.m index 58990aa0..ab241681 100644 --- a/sope-core/NGExtensions/NGBundleManager.m +++ b/sope-core/NGExtensions/NGBundleManager.m @@ -1892,16 +1892,24 @@ static BOOL debugLanguageLookup = NO; NSString *path = nil; int i, langCount; id (*objAtIdx)(id,SEL,int); - + if (debugLanguageLookup) { - NSLog(@"LOOKUP: %@ | %@ | %@ | %@", + NSLog(@"LOOKUP(%s): %@ | %@ | %@ | %@", __PRETTY_FUNCTION__, _name, _ext, _directory, [_languages componentsJoinedByString:@","]); } - path = [_directory isNotNull] - ? [[self bundlePath] stringByAppendingPathComponent:_directory] - : [self bundlePath]; - + path = [self bundlePath]; + if ([_directory isNotNull]) { + // TODO: should we change that? + path = [path stringByAppendingPathComponent:_directory]; + } + else { +#if (NeXT_Foundation_LIBRARY || APPLE_Foundation_LIBRARY) + path = [path stringByAppendingPathComponent:@"Contents"]; +#endif + path = [path stringByAppendingPathComponent:@"Resources"]; + } + if (debugLanguageLookup) NSLog(@" BASE: %@", path); fm = [NSFileManager defaultManager]; diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 8a5c4492..e21b17b7 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=152 +SUBMINOR_VERSION:=153 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39 -- 2.39.5