From c97b446ffd889b2c993a24f2a83ddf33c7f7726d Mon Sep 17 00:00:00 2001 From: rfm Date: Wed, 10 May 2006 13:06:57 +0000 Subject: [PATCH] Fix for loading where the files owner is in a library, framework or bundle, but the Gorm/NIB file is in the application resources. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22887 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 10 ++++++++++ Source/NSBundleAdditions.m | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 42a9ac8d6..92f928cbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2006-05-10 Richard Frith-Macdonald + + * Source/NSBundleAdditions.m: ([loadNibNamed:owner:]) if the NIB can't + be found in the owners bundle, try the main bundle of the application. + Fixes loading where the files owner is in a library, framework or + bundle, but the Gorm/NIB file is in the application resources. + I'm not sure this is the correct order, perhaps we should try the + main bundle first and the library/framework only if the rersource + is not in the main bundle. + 2006-05-06 Fred Kiefer * Resources/Esperanto.lproj/Localizable.string, diff --git a/Source/NSBundleAdditions.m b/Source/NSBundleAdditions.m index ff94e03da..db781fe8c 100644 --- a/Source/NSBundleAdditions.m +++ b/Source/NSBundleAdditions.m @@ -344,7 +344,13 @@ Class gmodel_class(void) } table = [NSDictionary dictionaryWithObject: owner forKey: @"NSOwner"]; bundle = [self bundleForClass: [owner class]]; - if (bundle == nil) + if (bundle != nil && [bundle loadNibFile: aNibName + externalNameTable: table + withZone: [owner zone]] == YES) + { + return YES; + } + else { bundle = [self mainBundle]; }