Centralise GSGuiBundle() routine

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@28830 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
sheldon 2009-10-17 05:05:35 +00:00
parent 541ba236db
commit 027f6c59ab
2 changed files with 15 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2009-10-17 Sheldon Gill <sheldon@westnet.net.au>
* Source/NSApplication.m: centralise GSGuiBundle() routine
2009-10-16 Sheldon Gill <sheldon@westnet.net.au>
* Source/NSEvent.m: add default for unknown events

View file

@ -152,13 +152,20 @@ _NSAppKitUncaughtExceptionHandler (NSException *exception)
}
}
/* This is the bundle from where we load localization of messages. */
static NSBundle *guiBundle = nil;
/* Get the bundle. */
NSBundle *
GSGuiBundle(void)
{
/* This is the bundle from where we load localization of messages. */
static NSBundle *guiBundle = nil;
if (!guiBundle)
{
/* Create the gui bundle we use to localize messages. */
guiBundle = [NSBundle bundleForLibrary: @"gnustep-gui"
version: OBJC_STRINGIFY(GNUSTEP_GUI_MAJOR_VERSION.GNUSTEP_GUI_MINOR_VERSION)];
RETAIN(guiBundle);
}
return guiBundle;
}
@ -716,12 +723,7 @@ static NSSize scaledIconSizeForSize(NSSize imageSize)
GSStringDrawingDummyFunction();
[self setVersion: 1];
/* Create the gui bundle we use to localize messages. */
guiBundle = [NSBundle bundleForLibrary: @"gnustep-gui"
version: OBJC_STRINGIFY(GNUSTEP_GUI_MAJOR_VERSION.GNUSTEP_GUI_MINOR_VERSION)];
RETAIN(guiBundle);
/* Cache the NSAutoreleasePool class */
arpClass = [NSAutoreleasePool class];
nc = [NSNotificationCenter defaultCenter];