From: helge Date: Thu, 17 Feb 2005 22:46:49 +0000 (+0000) Subject: minor code cleanups X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f77c4820a4628bba9c5e6c18704437f8b9f6388;p=sope minor code cleanups git-svn-id: http://svn.opengroupware.org/SOPE/trunk@572 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 45f7cf94..17696137 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,8 @@ +2005-02-17 Helge Hess + + * NGBundleManager.m: added some debugging code, minor code cleanups + (v4.5.150) + 2005-02-15 Helge Hess * NGObjCRuntime.m: fixed some issue with the last commit (v4.5.149) diff --git a/sope-core/NGExtensions/NGBundleManager.m b/sope-core/NGExtensions/NGBundleManager.m index 13321642..58990aa0 100644 --- a/sope-core/NGExtensions/NGBundleManager.m +++ b/sope-core/NGExtensions/NGBundleManager.m @@ -1880,25 +1880,35 @@ static BOOL _doesInfoMatch(NSArray *keys, NSDictionary *dict, NSDictionary *info @implementation NSBundle(NGLanguageResourceExtensions) +static BOOL debugLanguageLookup = NO; + // locating resources - (NSString *)pathForResource:(NSString *)_name ofType:(NSString *)_ext inDirectory:(NSString *)_directory languages:(NSArray *)_languages { - NSFileManager *fm = [NSFileManager defaultManager]; + NSFileManager *fm; NSString *path = nil; int i, langCount; id (*objAtIdx)(id,SEL,int); - path = _directory + if (debugLanguageLookup) { + NSLog(@"LOOKUP: %@ | %@ | %@ | %@", + _name, _ext, _directory, [_languages componentsJoinedByString:@","]); + } + + path = [_directory isNotNull] ? [[self bundlePath] stringByAppendingPathComponent:_directory] : [self bundlePath]; + if (debugLanguageLookup) NSLog(@" BASE: %@", path); + + fm = [NSFileManager defaultManager]; if (![fm fileExistsAtPath:path]) return nil; - if (_ext) _name = [_name stringByAppendingPathExtension:_ext]; + if (_ext != nil) _name = [_name stringByAppendingPathExtension:_ext]; langCount = [_languages count]; objAtIdx = (langCount > 0) @@ -1920,6 +1930,9 @@ static BOOL _doesInfoMatch(NSArray *keys, NSDictionary *dict, NSDictionary *info if ([fm fileExistsAtPath:lpath]) return lpath; } + + if (debugLanguageLookup) + NSLog(@" no language matched, check base: %@", path); /* now look into x.bundle/Resources/name.type */ if ([fm fileExistsAtPath:[path stringByAppendingPathComponent:_name]]) diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 7e2e8f48..300ba0b3 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,6 +1,6 @@ # version -SUBMINOR_VERSION:=149 +SUBMINOR_VERSION:=150 # v4.3.115 requires libFoundation v1.0.59 # v4.2.72 requires libEOControl v4.2.39