mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-14 16:20:57 +00:00
[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:
parent
5659406b7b
commit
1a89415bdc
1 changed files with 38 additions and 12 deletions
|
@ -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)
|
||||||
path = [system pathForResource: the_name
|
{
|
||||||
ofType: ext
|
#ifdef GNUSTEP_BASE_LIBRARY
|
||||||
inDirectory: NSImage_PATH];
|
path = [NSBundle pathForGNUstepResource: the_name
|
||||||
|
ofType: ext
|
||||||
|
inDirectory: @"Images"];
|
||||||
|
#else
|
||||||
|
NSBundle *system = [NSBundle bundleWithPath: @GNUSTEP_INSTALL_LIBDIR];
|
||||||
|
|
||||||
|
path = [system pathForResource: the_name
|
||||||
|
ofType: ext
|
||||||
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue