mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-02 09:31:07 +00:00
Further NSUserDefaults changes.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14981 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
454aa416a2
commit
b9ba67a850
2 changed files with 36 additions and 13 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2002-11-12 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSUserDefaults.m: Try again ... get
|
||||||
|
([-setVolatileDomain:forName:]) and ([-setPersistentDomain:forName:])
|
||||||
|
to conform to both the OpenStep standard and the current MacOS-X
|
||||||
|
documentation.
|
||||||
|
|
||||||
2002-11-11 Richard Frith-Macdonald <rfm@gnu.org>
|
2002-11-11 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSString.m: adocument property list stuff.
|
* Source/NSString.m: adocument property list stuff.
|
||||||
|
|
|
@ -1244,8 +1244,10 @@ static BOOL isPlistObject(id o)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replaces the persistent-domain specified by domainname with
|
* Replaces the persistent-domain specified by domainName with
|
||||||
* domain ... a dictionary containing keys and defaults values.
|
* domain ... a dictionary containing keys and defaults values.
|
||||||
|
* <br />Raises an NSInvalidArgumentException if domainName already
|
||||||
|
* exists as a volatile-domain.
|
||||||
* <br />Causes a NSUserDefaultsDidChangeNotification to be posted
|
* <br />Causes a NSUserDefaultsDidChangeNotification to be posted
|
||||||
* if this is the first change to a persistent-domain since the
|
* if this is the first change to a persistent-domain since the
|
||||||
* last -synchronize.
|
* last -synchronize.
|
||||||
|
@ -1253,7 +1255,16 @@ static BOOL isPlistObject(id o)
|
||||||
- (void) setPersistentDomain: (NSDictionary*)domain
|
- (void) setPersistentDomain: (NSDictionary*)domain
|
||||||
forName: (NSString*)domainName
|
forName: (NSString*)domainName
|
||||||
{
|
{
|
||||||
|
NSDictionary *dict;
|
||||||
|
|
||||||
[_lock lock];
|
[_lock lock];
|
||||||
|
dict = [_tempDomains objectForKey: domainName];
|
||||||
|
if (dict != nil)
|
||||||
|
{
|
||||||
|
[_lock unlock];
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"a volatile domain called %@ exists", domainName];
|
||||||
|
}
|
||||||
domain = [domain mutableCopy];
|
domain = [domain mutableCopy];
|
||||||
[_persDomains setObject: domain forKey: domainName];
|
[_persDomains setObject: domain forKey: domainName];
|
||||||
RELEASE(domain);
|
RELEASE(domain);
|
||||||
|
@ -1492,10 +1503,10 @@ static BOOL isPlistObject(id o)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the volatile-domain specified by domainname to
|
* Sets the volatile-domain specified by domainName to
|
||||||
* domain ... a dictionary containing keys and defaults values.
|
* domain ... a dictionary containing keys and defaults values.<br />
|
||||||
* <br />Raises an NSInvalidArgumentException if the named
|
* Raises an NSInvalidArgumentException if domainName already
|
||||||
* volatile-domain already exists.
|
* exists as either a volatile-domain or a persistent-domain.
|
||||||
*/
|
*/
|
||||||
- (void) setVolatileDomain: (NSDictionary*)domain
|
- (void) setVolatileDomain: (NSDictionary*)domain
|
||||||
forName: (NSString*)domainName
|
forName: (NSString*)domainName
|
||||||
|
@ -1503,22 +1514,27 @@ static BOOL isPlistObject(id o)
|
||||||
id dict;
|
id dict;
|
||||||
|
|
||||||
[_lock lock];
|
[_lock lock];
|
||||||
dict = [_tempDomains objectForKey: domainName];
|
dict = [_persDomains objectForKey: domainName];
|
||||||
if (dict)
|
if (dict != nil)
|
||||||
{
|
{
|
||||||
[_lock unlock];
|
[_lock unlock];
|
||||||
[NSException raise: NSInvalidArgumentException
|
[NSException raise: NSInvalidArgumentException
|
||||||
format: @"Volatile domain %@ already exists", domainName];
|
format: @"a persistent domain called %@ exists", domainName];
|
||||||
}
|
}
|
||||||
else
|
dict = [_tempDomains objectForKey: domainName];
|
||||||
|
if (dict != nil)
|
||||||
{
|
{
|
||||||
|
[_lock unlock];
|
||||||
|
[NSException raise: NSInvalidArgumentException
|
||||||
|
format: @"the volatile domain %@ already exists", domainName];
|
||||||
|
}
|
||||||
|
|
||||||
DESTROY(_dictionaryRep);
|
DESTROY(_dictionaryRep);
|
||||||
domain = [domain mutableCopy];
|
domain = [domain mutableCopy];
|
||||||
[_tempDomains setObject: domain forKey: domainName];
|
[_tempDomains setObject: domain forKey: domainName];
|
||||||
RELEASE(domain);
|
RELEASE(domain);
|
||||||
[_lock unlock];
|
[_lock unlock];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the volatile domain specified by domainName.
|
* Returns the volatile domain specified by domainName.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue