From ed18b7c3afe763684da55550f5effb19fefb5cd3 Mon Sep 17 00:00:00 2001 From: znek Date: Mon, 20 Sep 2004 12:26:17 +0000 Subject: [PATCH] new resource-lookup convenience method git-svn-id: http://svn.opengroupware.org/SOPE/trunk@139 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- sope-core/NGExtensions/ChangeLog | 10 ++++ .../NGExtensions/FdExt.subproj/GNUmakefile | 1 + .../FdExt.subproj/NSBundle+misc.m | 55 +++++++++++++++++++ sope-core/NGExtensions/GNUmakefile | 1 + .../NGExtensions.xcode/project.pbxproj | 34 ++++++++++++ .../NGExtensions/NGExtensions/NGExtensions.h | 1 + .../NGExtensions/NGExtensions/NSBundle+misc.h | 37 +++++++++++++ sope-core/NGExtensions/Version | 5 +- sope-core/sope-core.xcode/project.pbxproj | 8 +-- 9 files changed, 146 insertions(+), 6 deletions(-) create mode 100644 sope-core/NGExtensions/FdExt.subproj/NSBundle+misc.m create mode 100644 sope-core/NGExtensions/NGExtensions/NSBundle+misc.h diff --git a/sope-core/NGExtensions/ChangeLog b/sope-core/NGExtensions/ChangeLog index 78c06dd1..d175ee92 100644 --- a/sope-core/NGExtensions/ChangeLog +++ b/sope-core/NGExtensions/ChangeLog @@ -1,3 +1,13 @@ +2004-09-20 Marcus Mueller + + * v4.3.115 + + * NGExtensions/NSBundle+misc.h, FdExt.subproj/NSBundle+misc.m: new + NSBundle method -pathForResource:ofType:inDirectory:forLocalizations: + + * NGExtensions/NGExtensions.h: added NSBundle+misc.h to the public + headers + 2004-09-06 Helge Hess * FdExt.subproj/NSFileManager+Extensions.m: added new method: diff --git a/sope-core/NGExtensions/FdExt.subproj/GNUmakefile b/sope-core/NGExtensions/FdExt.subproj/GNUmakefile index bcaeb874..b3930a15 100644 --- a/sope-core/NGExtensions/FdExt.subproj/GNUmakefile +++ b/sope-core/NGExtensions/FdExt.subproj/GNUmakefile @@ -7,6 +7,7 @@ SUBPROJECT_NAME = FdExt FdExt_OBJC_FILES = \ NSArray+enumerator.m \ NSAutoreleasePool+misc.m \ + NSBundle+misc.m \ NSCalendarDate+misc.m \ NSData+gzip.m \ NSData+misc.m \ diff --git a/sope-core/NGExtensions/FdExt.subproj/NSBundle+misc.m b/sope-core/NGExtensions/FdExt.subproj/NSBundle+misc.m new file mode 100644 index 00000000..a165fa03 --- /dev/null +++ b/sope-core/NGExtensions/FdExt.subproj/NSBundle+misc.m @@ -0,0 +1,55 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + */ + + +#import "common.h" +#import "NSBundle+misc.h" + +#ifndef LIB_FOUNDATION_LIBRARY + +@implementation NSBundle(misc) + +- (NSString*)pathForResource:(NSString*)name ofType:(NSString*)ext + inDirectory:(NSString*)directory + forLocalizations:(NSArray*)localizationNames +{ + if(!localizationNames) { + return [self pathForResource:name ofType:ext inDirectory:directory]; + } + else { + unsigned i, count; + + count = [localizationNames count]; + for(i = 0; i < count; i++) { + NSString *lname, *path; + + lname = [localizationNames objectAtIndex:i]; + path = [self pathForResource:name ofType:ext inDirectory:directory + forLocalization:lname]; + if(path) + return path; + } + } + return nil; +} + +@end /* NSBundle(misc) */ +#endif diff --git a/sope-core/NGExtensions/GNUmakefile b/sope-core/NGExtensions/GNUmakefile index 46683ec6..68a90542 100644 --- a/sope-core/NGExtensions/GNUmakefile +++ b/sope-core/NGExtensions/GNUmakefile @@ -85,6 +85,7 @@ EOExt_HEADER_FILES = \ FdExt_HEADER_FILES = \ NSArray+enumerator.h \ NSAutoreleasePool+misc.h \ + NSBundle+misc.h \ NSCalendarDate+misc.h \ NSData+gzip.h \ NSData+misc.h \ diff --git a/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj b/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj index 91fe04e4..ba82b2cf 100644 --- a/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj +++ b/sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj @@ -5,6 +5,36 @@ }; objectVersion = 39; objects = { + ADD45B5E06FEF017004BBD65 = { + fileEncoding = 5; + indentWidth = 2; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + path = "NSBundle+misc.h"; + refType = 4; + sourceTree = ""; + }; + ADD45B5F06FEF017004BBD65 = { + fileEncoding = 5; + indentWidth = 2; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = "NSBundle+misc.m"; + refType = 4; + sourceTree = ""; + }; + ADD45B6006FEF017004BBD65 = { + fileRef = ADD45B5E06FEF017004BBD65; + isa = PBXBuildFile; + settings = { + }; + }; + ADD45B6106FEF017004BBD65 = { + fileRef = ADD45B5F06FEF017004BBD65; + isa = PBXBuildFile; + settings = { + }; + }; ADD65B6606DA32D6007161CA = { children = ( ADD65C7106DA343C007161CA, @@ -272,6 +302,7 @@ ADD65C3A06DA336E007161CA, ADD65C3B06DA336E007161CA, ADD65C3C06DA336E007161CA, + ADD45B5F06FEF017004BBD65, ADD65C3D06DA336E007161CA, ADD65C3E06DA336E007161CA, ADD65C3F06DA336E007161CA, @@ -1070,6 +1101,7 @@ ADD65DE706DA3830007161CA, ADD65DE806DA3830007161CA, ADD65DE906DA3830007161CA, + ADD45B6006FEF017004BBD65, ); isa = PBXHeadersBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -1156,6 +1188,7 @@ ADD65F3106DA397E007161CA, ADD65F3206DA397E007161CA, ADD65F3306DA397E007161CA, + ADD45B6106FEF017004BBD65, ); isa = PBXSourcesBuildPhase; runOnlyForDeploymentPostprocessing = 0; @@ -2558,6 +2591,7 @@ children = ( ADD65D9006DA3830007161CA, ADD65D9106DA3830007161CA, + ADD45B5E06FEF017004BBD65, ADD65D9206DA3830007161CA, ADD65D9306DA3830007161CA, ADD65D9406DA3830007161CA, diff --git a/sope-core/NGExtensions/NGExtensions/NGExtensions.h b/sope-core/NGExtensions/NGExtensions/NGExtensions.h index 52839d44..a52c195d 100644 --- a/sope-core/NGExtensions/NGExtensions/NGExtensions.h +++ b/sope-core/NGExtensions/NGExtensions/NGExtensions.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include diff --git a/sope-core/NGExtensions/NGExtensions/NSBundle+misc.h b/sope-core/NGExtensions/NGExtensions/NSBundle+misc.h new file mode 100644 index 00000000..84c71878 --- /dev/null +++ b/sope-core/NGExtensions/NGExtensions/NSBundle+misc.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +#ifndef __NGExtensions_NSBundle_misc_H__ +#define __NGExtensions_NSBundle_misc_H__ + + +#import + + +@interface NSBundle (misc) + +- (NSString*)pathForResource:(NSString*)name ofType:(NSString*)ext + inDirectory:(NSString*)directory + forLocalizations:(NSArray*)localizationNames; + +@end + +#endif /* __NGExtensions_NSBundle_misc_H__ */ diff --git a/sope-core/NGExtensions/Version b/sope-core/NGExtensions/Version index 596f871c..5e078f86 100644 --- a/sope-core/NGExtensions/Version +++ b/sope-core/NGExtensions/Version @@ -1,5 +1,6 @@ # version -SUBMINOR_VERSION:=114 +SUBMINOR_VERSION:=115 -# v4.2.72 requires libEOControl v4.2.39 +# v4.3.115 requires libFoundation v1.0.59 +# v4.2.72 requires libEOControl v4.2.39 diff --git a/sope-core/sope-core.xcode/project.pbxproj b/sope-core/sope-core.xcode/project.pbxproj index 0ef750b9..1e6342fe 100644 --- a/sope-core/sope-core.xcode/project.pbxproj +++ b/sope-core/sope-core.xcode/project.pbxproj @@ -65,10 +65,6 @@ mainGroup = ADDF476606DA572500C4E7F8; projectDirPath = ""; projectReferences = ( - { - ProductGroup = ADDF478906DA583300C4E7F8; - ProjectRef = ADDF478806DA583300C4E7F8; - }, { ProductGroup = ADDF478506DA580C00C4E7F8; ProjectRef = ADDF478406DA580C00C4E7F8; @@ -77,6 +73,10 @@ ProductGroup = ADDF478706DA581F00C4E7F8; ProjectRef = ADDF478606DA581F00C4E7F8; }, + { + ProductGroup = ADDF478906DA583300C4E7F8; + ProjectRef = ADDF478806DA583300C4E7F8; + }, ); targets = ( ADDF479906DA58D700C4E7F8, -- 2.39.5