]> err.no Git - sope/commitdiff
new resource-lookup convenience method
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 20 Sep 2004 12:26:17 +0000 (12:26 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 20 Sep 2004 12:26:17 +0000 (12:26 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@139 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-core/NGExtensions/ChangeLog
sope-core/NGExtensions/FdExt.subproj/GNUmakefile
sope-core/NGExtensions/FdExt.subproj/NSBundle+misc.m [new file with mode: 0644]
sope-core/NGExtensions/GNUmakefile
sope-core/NGExtensions/NGExtensions.xcode/project.pbxproj
sope-core/NGExtensions/NGExtensions/NGExtensions.h
sope-core/NGExtensions/NGExtensions/NSBundle+misc.h [new file with mode: 0644]
sope-core/NGExtensions/Version
sope-core/sope-core.xcode/project.pbxproj

index 78c06dd10e4d2920a9738648b09f0803fd029496..d175ee924cf81212958b7ccbf26359f97a71edb5 100644 (file)
@@ -1,3 +1,13 @@
+2004-09-20  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * 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  <helge.hess@skyrix.com>
        
        * FdExt.subproj/NSFileManager+Extensions.m: added new method:
index bcaeb874f0af70d0a45c131406c7f1f031a67c64..b3930a15d75346c9549351292edffa0ed0c0ca1f 100644 (file)
@@ -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 (file)
index 0000000..a165fa0
--- /dev/null
@@ -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
index 46683ec615839e0d724c8d1c6f0fb55eb853c188..68a90542c1afcc9a3f9bb8096073a51f4932a439 100644 (file)
@@ -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                   \
index 91fe04e4b68297bc90857f821fbbf665cf5615b8..ba82b2cfbe951dee23a028bdc9a907e4d658892e 100644 (file)
@@ -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 = "<group>";
+               };
+               ADD45B5F06FEF017004BBD65 = {
+                       fileEncoding = 5;
+                       indentWidth = 2;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = "NSBundle+misc.m";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               ADD45B6006FEF017004BBD65 = {
+                       fileRef = ADD45B5E06FEF017004BBD65;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
+               ADD45B6106FEF017004BBD65 = {
+                       fileRef = ADD45B5F06FEF017004BBD65;
+                       isa = PBXBuildFile;
+                       settings = {
+                       };
+               };
                ADD65B6606DA32D6007161CA = {
                        children = (
                                ADD65C7106DA343C007161CA,
                                ADD65C3A06DA336E007161CA,
                                ADD65C3B06DA336E007161CA,
                                ADD65C3C06DA336E007161CA,
+                               ADD45B5F06FEF017004BBD65,
                                ADD65C3D06DA336E007161CA,
                                ADD65C3E06DA336E007161CA,
                                ADD65C3F06DA336E007161CA,
                                ADD65DE706DA3830007161CA,
                                ADD65DE806DA3830007161CA,
                                ADD65DE906DA3830007161CA,
+                               ADD45B6006FEF017004BBD65,
                        );
                        isa = PBXHeadersBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                                ADD65F3106DA397E007161CA,
                                ADD65F3206DA397E007161CA,
                                ADD65F3306DA397E007161CA,
+                               ADD45B6106FEF017004BBD65,
                        );
                        isa = PBXSourcesBuildPhase;
                        runOnlyForDeploymentPostprocessing = 0;
                        children = (
                                ADD65D9006DA3830007161CA,
                                ADD65D9106DA3830007161CA,
+                               ADD45B5E06FEF017004BBD65,
                                ADD65D9206DA3830007161CA,
                                ADD65D9306DA3830007161CA,
                                ADD65D9406DA3830007161CA,
index 52839d44693fb6b25ded643d50bb7ce8ed02b614..a52c195d8b7dbcff7cae67fb40e2a163a57a6d2f 100644 (file)
@@ -47,6 +47,7 @@
 #include <NGExtensions/NGQuotedPrintableCoding.h>
 #include <NGExtensions/NGStack.h>
 #include <NGExtensions/NSArray+enumerator.h>
+#include <NGExtensions/NSBundle+misc.h>
 #include <NGExtensions/NSCalendarDate+misc.h>
 #include <NGExtensions/NSData+misc.h>
 #include <NGExtensions/NSDictionary+misc.h>
diff --git a/sope-core/NGExtensions/NGExtensions/NSBundle+misc.h b/sope-core/NGExtensions/NGExtensions/NSBundle+misc.h
new file mode 100644 (file)
index 0000000..84c7187
--- /dev/null
@@ -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 <Foundation/NSBundle.h>
+
+
+@interface NSBundle (misc)
+
+- (NSString*)pathForResource:(NSString*)name ofType:(NSString*)ext
+  inDirectory:(NSString*)directory
+  forLocalizations:(NSArray*)localizationNames;
+
+@end
+
+#endif /* __NGExtensions_NSBundle_misc_H__ */
index 596f871cff79cce0f7f59a813d2306c41f3c9f65..5e078f869010545cf6e344caa5ff3c5c9af7b434 100644 (file)
@@ -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
index 0ef750b94b07e8df72b59a98474c86723aa555bf..1e6342fed1e276ff86bc33b12837ee406a4402cc 100644 (file)
                        mainGroup = ADDF476606DA572500C4E7F8;
                        projectDirPath = "";
                        projectReferences = (
-                               {
-                                       ProductGroup = ADDF478906DA583300C4E7F8;
-                                       ProjectRef = ADDF478806DA583300C4E7F8;
-                               },
                                {
                                        ProductGroup = ADDF478506DA580C00C4E7F8;
                                        ProjectRef = ADDF478406DA580C00C4E7F8;
                                        ProductGroup = ADDF478706DA581F00C4E7F8;
                                        ProjectRef = ADDF478606DA581F00C4E7F8;
                                },
+                               {
+                                       ProductGroup = ADDF478906DA583300C4E7F8;
+                                       ProjectRef = ADDF478806DA583300C4E7F8;
+                               },
                        );
                        targets = (
                                ADDF479906DA58D700C4E7F8,