See ChangeLog

Monotone-Parent: 90a8d72f1dd06d625072289c8e80770857c17810
Monotone-Revision: b650569887c118b01da27c8339a401335419846c

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2009-03-03T19:08:02
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Ludovic Marcotte
2009-03-03 19:08:02 +00:00
parent 290cec8c6f
commit 997299688d
8 changed files with 130 additions and 104 deletions
+38 -10
View File
@@ -316,6 +316,23 @@ static NSLock *lock;
return [[users objectForKey: theLogin] objectForKey: @"settings"];
}
//
//
//
- (void) setDefaults: (SOGoUserDefaults *) theDefaults
forLogin: (NSString *) theLogin
key: (NSString *) theKey
{
if (![users objectForKey: theLogin])
[users setObject: [NSMutableDictionary dictionary] forKey: theLogin];
[[users objectForKey: theLogin] setObject: theDefaults forKey: theKey];
[[users objectForKey: theLogin] setObject: [[NSDate date] addTimeInterval: [SOGoCache cleanupInterval]]
forKey: @"cleanupDate"];
//NSLog(@"Set %@ to %@", theKey, [users objectForKey: theLogin]);
}
//
// Notification callbacks.
//
@@ -336,21 +353,17 @@ static NSLock *lock;
uid: theLogin
fieldName: [NSString stringWithFormat: @"c_%@", theKey]]
autorelease];
if (![users objectForKey: theLogin])
[users setObject: [NSMutableDictionary dictionary] forKey: theLogin];
[defaults setValues: theValues];
[self setDefaults: defaults forLogin: theLogin key: theKey];
[[users objectForKey: theLogin] setObject: defaults forKey: theKey];
[[users objectForKey: theLogin] setObject: [[NSDate date] addTimeInterval: [SOGoCache cleanupInterval]]
forKey: @"cleanupDate"];
//NSLog(@"\n\n\nCached user %@ for UID: %@\nvalues: %@\n\n", theKey, theLogin, theValues);
#if defined(THREADSAFE)
[lock unlock];
#endif
}
//
//
//
- (void) _userAttributesHaveLoaded: (NSNotification *) theNotification
{
NSString *uid;
@@ -380,6 +393,9 @@ static NSLock *lock;
}
}
//
//
//
- (void) _userDefaultsHaveLoaded: (NSNotification *) theNotification
{
NSString *uid;
@@ -395,11 +411,14 @@ static NSLock *lock;
}
}
//
//
//
- (void) _userDefaultsHaveChanged: (NSNotification *) theNotification
{
SOGoUserDefaults *defaults;
NSString *uid;
uid = [[theNotification userInfo] objectForKey: @"uid"];
//NSLog(@"Updating user defaults for UID: %@", uid);
defaults = (SOGoUserDefaults *)[self userDefaultsForLogin: uid];
@@ -424,6 +443,9 @@ static NSLock *lock;
}
}
//
//
//
- (void) _userSettingsHaveLoaded: (NSNotification *) theNotification
{
NSString *uid;
@@ -439,6 +461,9 @@ static NSLock *lock;
}
}
//
//
//
- (void) _userSettingsHaveChanged: (NSNotification *) theNotification
{
SOGoUserDefaults *settings;
@@ -468,6 +493,9 @@ static NSLock *lock;
}
}
//
//
//
- (void) _cleanupSources
{
NSDictionary *currentEntry;