[initialize] and [imageNamed:] use hardcoded

@GNUSTEP_INSTALL_LIBDIR only for non-GNUstep foundation library.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@11600 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2001-12-02 11:45:01 +00:00
parent 5659406b7b
commit 1a89415bdc

View file

@ -57,10 +57,6 @@
BOOL NSImageDoesCaching = YES; /* enable caching */ BOOL NSImageDoesCaching = YES; /* enable caching */
BOOL NSImageForceCaching = NO; /* use on missmatch */ BOOL NSImageForceCaching = NO; /* use on missmatch */
// Resource directories
static NSString* gnustep_libdir = @GNUSTEP_INSTALL_LIBDIR;
static NSString* NSImage_PATH = @"Images";
@interface GSRepData : NSObject @interface GSRepData : NSObject
{ {
@public @public
@ -134,10 +130,17 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
{ {
if (self == [NSImage class]) if (self == [NSImage class])
{ {
NSBundle *system = [NSBundle bundleWithPath: gnustep_libdir]; #ifdef GNUSTEP_BASE_LIBRARY
NSString *path = [NSBundle pathForGNUstepResource: @"nsmapping"
ofType: @"strings"
inDirectory: @"Images"];
#else
NSBundle *system = [NSBundle bundleWithPath: @GNUSTEP_INSTALL_LIBDIR];
NSString *path = [system pathForResource: @"nsmapping" NSString *path = [system pathForResource: @"nsmapping"
ofType: @"strings" ofType: @"strings"
inDirectory: NSImage_PATH]; inDirectory: @"Images"];
#endif
// Initial version // Initial version
[self setVersion: 1]; [self setVersion: 1];
@ -216,14 +219,36 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
/* If not found then search in system */ /* If not found then search in system */
if (!path) if (!path)
{ {
NSBundle *system = [NSBundle bundleWithPath: gnustep_libdir];
if (ext) if (ext)
{
#ifdef GNUSTEP_BASE_LIBRARY
path = [NSBundle pathForGNUstepResource: the_name
ofType: ext
inDirectory: @"Images"];
#else
NSBundle *system = [NSBundle bundleWithPath: @GNUSTEP_INSTALL_LIBDIR];
path = [system pathForResource: the_name path = [system pathForResource: the_name
ofType: ext ofType: ext
inDirectory: NSImage_PATH]; inDirectory: @"Images"];
#endif
}
else else
{ {
#ifdef GNUSTEP_BASE_LIBRARY
id o, e;
e = [array objectEnumerator];
while ((o = [e nextObject]))
{
path = [NSBundle pathForGNUstepResource: the_name
ofType: o
inDirectory: @"Images"];
if (path != nil && [path length] != 0)
break;
}
#else
NSBundle *system = [NSBundle bundleWithPath: @GNUSTEP_INSTALL_LIBDIR];
id o, e; id o, e;
e = [array objectEnumerator]; e = [array objectEnumerator];
@ -231,10 +256,11 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep)
{ {
path = [system pathForResource: the_name path = [system pathForResource: the_name
ofType: o ofType: o
inDirectory: NSImage_PATH]; inDirectory: @"Images"];
if (path != nil && [path length] != 0) if (path != nil && [path length] != 0)
break; break;
} }
#endif
} }
} }