mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 12:00:52 +00:00
* Source/NSImage.m: -[NSImage initWithCoder:] an extension to
the previous change. If the URL doesn't load then try to load the image in the NSURL as a "named" image in resources so that the developer of the app has a way to provide this image. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35316 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1a81de9b5d
commit
38ea4d65a6
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
2012-07-24 06:30-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSImage.m: -[NSImage initWithCoder:] an extension to
|
||||
the previous change. If the URL doesn't load then try to load
|
||||
the image in the NSURL as a "named" image in resources so that
|
||||
the developer of the app has a way to provide this image.
|
||||
|
||||
2012-07-20 14:06-EDT Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Source/NSImage.m: -[NSImage initWithCoder:]
|
||||
|
@ -8,7 +15,7 @@
|
|||
|
||||
2012-07-05 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Headers/AppKit/NSNibDeclarations.h: Fixed recent Clang warnings when
|
||||
* Headers/AppKit/NSNibDeclarations.h: Fixed recent Clang warnings when
|
||||
compiling applications about IBOutlet and IBAction being already defined.
|
||||
|
||||
2012-06-29 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
|
|
@ -1662,6 +1662,17 @@ static NSSize GSResolutionOfImageRep(NSImageRep *rep)
|
|||
if([rep isKindOfClass:[NSURL class]])
|
||||
{
|
||||
rep = [NSImageRep imageRepWithContentsOfURL:rep];
|
||||
|
||||
// If we are unable to resolved the URL, try to get it from the
|
||||
// resources folder.
|
||||
if(rep == nil)
|
||||
{
|
||||
NSString *fileName = [[rep absoluteString] lastPathComponent];
|
||||
NSString *path = [[NSBundle mainBundle] pathForImageResource:fileName];
|
||||
rep = [NSImageRep imageRepWithContentsOfFile:path];
|
||||
}
|
||||
|
||||
// If the representation was found, add it...
|
||||
if(rep != nil)
|
||||
{
|
||||
[self addRepresentation: rep];
|
||||
|
|
Loading…
Reference in a new issue