mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-25 16:33:22 +00:00
Monotone-Parent: 1a1f30934eb19691177704c8c1a92697a45c390e
Monotone-Revision: 36d728b2182b4efc40beae193f9900664ed79af7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-01-13T20:39:10 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
+50
-32
@@ -464,54 +464,72 @@ _timeValue (NSString *key)
|
|||||||
return dateFormatter;
|
return dateFormatter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (SOGoUserDefaults *) primaryUserDefaults
|
||||||
|
{
|
||||||
|
SOGoUserDefaults *o;
|
||||||
|
|
||||||
|
o = [[SOGoUserDefaults alloc] initWithTableURL: SOGoProfileURL
|
||||||
|
uid: login
|
||||||
|
fieldName: @"c_defaults"];
|
||||||
|
[o autorelease];
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (SOGoUserDefaults *) primaryUserSettings
|
||||||
|
{
|
||||||
|
SOGoUserDefaults *o;
|
||||||
|
|
||||||
|
o = [[SOGoUserDefaults alloc] initWithTableURL: SOGoProfileURL
|
||||||
|
uid: login
|
||||||
|
fieldName: @"c_settings"];
|
||||||
|
[o autorelease];
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSUserDefaults *) userDefaults
|
- (NSUserDefaults *) userDefaults
|
||||||
{
|
{
|
||||||
id o;
|
SOGoUserDefaults *defaults;
|
||||||
|
NSDictionary *cachedDefaults;
|
||||||
|
|
||||||
o = [[SOGoCache cachedUserDefaults] objectForKey: login];
|
cachedDefaults = [[SOGoCache cachedUserDefaults] objectForKey: login];
|
||||||
|
if (cachedDefaults)
|
||||||
if (!o)
|
defaults = [cachedDefaults objectForKey: @"dictionary"];
|
||||||
|
else
|
||||||
{
|
{
|
||||||
o = [[SOGoUserDefaults alloc] initWithTableURL: SOGoProfileURL
|
defaults = [self primaryUserDefaults];
|
||||||
uid: login
|
|
||||||
fieldName: @"c_defaults"];
|
|
||||||
/* Required parameters for the web interface */
|
/* Required parameters for the web interface */
|
||||||
if (![[o stringForKey: @"ReplyPlacement"] length])
|
if (![[defaults stringForKey: @"ReplyPlacement"] length])
|
||||||
[o setObject: defaultReplyPlacement forKey: @"ReplyPlacement"];
|
[defaults setObject: defaultReplyPlacement forKey: @"ReplyPlacement"];
|
||||||
if (![[o stringForKey: @"SignaturePlacement"] length])
|
if (![[defaults stringForKey: @"SignaturePlacement"] length])
|
||||||
[o setObject: defaultSignaturePlacement forKey: @"SignaturePlacement"];
|
[defaults setObject: defaultSignaturePlacement forKey: @"SignaturePlacement"];
|
||||||
if (![[o stringForKey: @"MessageForwarding"] length])
|
if (![[defaults stringForKey: @"MessageForwarding"] length])
|
||||||
[o setObject: defaultMessageForwarding forKey: @"MessageForwarding"];
|
[defaults setObject: defaultMessageForwarding forKey: @"MessageForwarding"];
|
||||||
if (![[o stringForKey: @"MessageCheck"] length])
|
if (![[defaults stringForKey: @"MessageCheck"] length])
|
||||||
[o setObject: defaultMessageCheck forKey: @"MessageCheck"];
|
[defaults setObject: defaultMessageCheck forKey: @"MessageCheck"];
|
||||||
|
|
||||||
[SOGoCache setCachedUserDefaults: o user: login];
|
[SOGoCache setCachedUserDefaults: defaults user: login];
|
||||||
[o release];
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [o objectForKey: @"dictionary"];
|
return (NSUserDefaults *) defaults;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSUserDefaults *) userSettings
|
- (NSUserDefaults *) userSettings
|
||||||
{
|
{
|
||||||
id o;
|
SOGoUserDefaults *settings;
|
||||||
|
NSDictionary *cachedSettings;
|
||||||
|
|
||||||
o = [[SOGoCache cachedUserSettings] objectForKey: login];
|
cachedSettings = [[SOGoCache cachedUserSettings] objectForKey: login];
|
||||||
|
if (cachedSettings)
|
||||||
if (!o)
|
settings = [cachedSettings objectForKey: @"dictionary"];
|
||||||
|
else
|
||||||
{
|
{
|
||||||
o = [[SOGoUserDefaults alloc] initWithTableURL: SOGoProfileURL
|
settings = [self primaryUserSettings];
|
||||||
uid: login
|
[SOGoCache setCachedUserSettings: settings user: login];
|
||||||
fieldName: @"c_settings"];
|
|
||||||
[SOGoCache setCachedUserSettings: o user: login];
|
|
||||||
[o release];
|
|
||||||
|
|
||||||
return o;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return [o objectForKey: @"dictionary"];
|
return (NSUserDefaults *) settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) language
|
- (NSString *) language
|
||||||
|
|||||||
Reference in New Issue
Block a user