Fixup merging of config into the Control process

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/ec/trunk@38330 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-02-04 10:32:07 +00:00
parent f5287d4e79
commit e1d9d86a61
3 changed files with 27 additions and 0 deletions

View file

@ -2881,6 +2881,23 @@ static NSString* cmdWord(NSArray* a, unsigned int pos)
if (YES == changed)
{
/* Merge the globalconfiguration into this process' user defaults.
* Don't forget to preserve the Alerter config.
*/
d = [config objectForKey: @"*"];
if ([d isKindOfClass: [NSDictionary class]])
{
d = [config objectForKey: @"*"];
}
if (YES == [d isKindOfClass: [NSDictionary class]])
{
dict = [d mutableCopy];
[dict setObject: [[self cmdDefaults] objectForKey: @"Alerter"]
forKey: @"Alerter"];
[[self cmdDefaults] setConfiguration: dict];
[dict release];
}
dict = [NSMutableDictionary dictionaryWithCapacity: 3];
/*

View file

@ -53,6 +53,11 @@
+ (NSUserDefaults*) userDefaultsWithPrefix: (NSString*)aPrefix
strict: (BOOL)enforcePrefix;
/** Returns the current configuration settings dictionary (as set using
* the -setConfiguration: method).
*/
- (NSDictionary*) configuration;
/** Returns the prefix used by the receiver, or nil if no prefix is in use.
*/
- (NSString*) defaultsPrefix;

View file

@ -280,6 +280,11 @@ static NSLock *lock = nil;
aPrefix strict: enforcePrefix] autorelease];
}
- (NSDictionary*) configuration
{
return [self volatileDomainForName: @"EcConfiguration"];
}
- (NSString*) defaultsPrefix
{
return nil; // No prefix in use ... this is not a proxy