mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 07:10:47 +00:00
Fix NSImage so that it searches system resource directory properly.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@2226 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5fda1b1a07
commit
8ed2402f35
2 changed files with 12 additions and 10 deletions
|
@ -23,6 +23,8 @@ Tue Mar 4 09:28:57 1997 GNUstep Development <gnustep@net-community.com>
|
||||||
|
|
||||||
* Source/NSFont.m (getFont): Return font not font name.
|
* Source/NSFont.m (getFont): Return font not font name.
|
||||||
* Images/Makefile.in: Install common_Dimple.tiff.
|
* Images/Makefile.in: Install common_Dimple.tiff.
|
||||||
|
* Source/NSBundle.m (+imageNamed:): Create a bundle with
|
||||||
|
gnustep library install path for searching system resources.
|
||||||
|
|
||||||
Mon Feb 17 19:30:50 1997 Ovidiu Predescu <ovidiu@bx.logicnet.ro>
|
Mon Feb 17 19:30:50 1997 Ovidiu Predescu <ovidiu@bx.logicnet.ro>
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,9 @@
|
||||||
#include <AppKit/NSScreen.h>
|
#include <AppKit/NSScreen.h>
|
||||||
#include <AppKit/NSColor.h>
|
#include <AppKit/NSColor.h>
|
||||||
|
|
||||||
static NSString* NSImage_PATH
|
// Resource directories
|
||||||
= @GNUSTEP_INSTALL_LIBDIR @"/Images";
|
static NSString* gnustep_libdir = @GNUSTEP_INSTALL_LIBDIR;
|
||||||
|
static NSString* NSImage_PATH = @"Images";
|
||||||
|
|
||||||
/* Backend protocol - methods that must be implemented by the backend to
|
/* Backend protocol - methods that must be implemented by the backend to
|
||||||
complete the class */
|
complete the class */
|
||||||
|
@ -188,12 +189,12 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
|
||||||
/* If not found then search in system */
|
/* If not found then search in system */
|
||||||
if (!path)
|
if (!path)
|
||||||
{
|
{
|
||||||
NSArray* dirsArray = [NSArray arrayWithObject:NSImage_PATH];
|
NSBundle *system = [NSBundle bundleWithPath: gnustep_libdir];
|
||||||
|
|
||||||
if (ext)
|
if (ext)
|
||||||
path = [NSBundle pathForResource: aName
|
path = [system pathForResource: aName
|
||||||
ofType: ext
|
ofType: ext
|
||||||
inDirectories:dirsArray];
|
inDirectory: NSImage_PATH];
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
id o, e;
|
id o, e;
|
||||||
|
@ -205,10 +206,9 @@ set_repd_for_rep(NSMutableArray *_reps, NSImageRep *rep, rep_data_t *new_repd)
|
||||||
e = [array objectEnumerator];
|
e = [array objectEnumerator];
|
||||||
while ((o = [e nextObject]))
|
while ((o = [e nextObject]))
|
||||||
{
|
{
|
||||||
NSDebugLog(@"extension %s, array = %@\n", [o cString], dirsArray);
|
path = [system pathForResource: aName
|
||||||
path = [NSBundle pathForResource: aName
|
ofType: o
|
||||||
ofType: o
|
inDirectory: NSImage_PATH];
|
||||||
inDirectories:dirsArray];
|
|
||||||
if ([path length] != 0)
|
if ([path length] != 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue