Minor macos-x compatibility tweak.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25547 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2007-10-31 11:24:30 +00:00
parent c64809ccc8
commit 51e7ad576b
3 changed files with 15 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2007-10-31 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSUserDefaults.m: ([setBoolForKey:]) changed to store YES
or NO as a string for MacOS-X compatibility.
2007-10-30 Adam Fedor <fedor@gnu.org>
* gnustep-base.spec.in: Change Copyright to License.

View file

@ -363,8 +363,8 @@ GS_EXPORT NSString* const NSLocale;
/**
* Sets a boolean value for defaultName in the application domain.<br />
* Calls -setObject:forKey: to make the change by storing a boolean
* [NSNumber] instance.
* Calls -setObject:forKey: to make the change by storing a string
* containing either the word YES or NO.
*/
- (void) setBool: (BOOL)value forKey: (NSString*)defaultName;

View file

@ -1047,9 +1047,14 @@ static BOOL setSharedDefaults = NO; /* Flag to prevent infinite recursion */
- (void) setBool: (BOOL)value forKey: (NSString*)defaultName
{
NSNumber *n = [NSNumberClass numberWithBool: value];
[self setObject: n forKey: defaultName];
if (value == YES)
{
[self setObject: @"YES" forKey: defaultName];
}
else
{
[self setObject: @"NO" forKey: defaultName];
}
}
- (void) setFloat: (float)value forKey: (NSString*)defaultName