mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 08:55:08 +00:00
Added the SOGoUserManager class (not used right now) to cache user preferences. Fixed tons of bugs wrt invitations handling and more cleanup needs to be done.
Monotone-Parent: 56b6e4ca9c570a4e36d00e32127d539e82da7293 Monotone-Revision: db186d0ad7ef7cd1cab54a0ee31f87daa7c32085 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2008-11-05T21:04:16 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#import <Foundation/NSCalendarDate.h>
|
||||
#import <Foundation/NSDistributedNotificationCenter.h>
|
||||
#import <Foundation/NSPropertyList.h>
|
||||
#import <Foundation/NSUserDefaults.h>
|
||||
#import <Foundation/NSValue.h>
|
||||
@@ -50,7 +51,6 @@ static NSString *uidColumnName = @"c_uid";
|
||||
if (tableURL && [userID length] > 0
|
||||
&& [defaultsFieldName length] > 0)
|
||||
{
|
||||
parent = [[NSUserDefaults standardUserDefaults] retain];
|
||||
fieldName = [defaultsFieldName copy];
|
||||
url = [tableURL copy];
|
||||
uid = [userID copy];
|
||||
@@ -77,7 +77,6 @@ static NSString *uidColumnName = @"c_uid";
|
||||
{
|
||||
[values release];
|
||||
[lastFetch release];
|
||||
[parent release];
|
||||
[url release];
|
||||
[uid release];
|
||||
[fieldName release];
|
||||
@@ -101,11 +100,6 @@ static NSString *uidColumnName = @"c_uid";
|
||||
return fieldName;
|
||||
}
|
||||
|
||||
- (NSUserDefaults *) parentDefaults
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
/* operation */
|
||||
|
||||
- (BOOL) primaryFetchProfile
|
||||
@@ -275,6 +269,18 @@ static NSString *uidColumnName = @"c_uid";
|
||||
[self errorWithFormat: @"could not run SQL '%@': %@", sql, ex];
|
||||
else
|
||||
{
|
||||
NSMutableDictionary *d;
|
||||
|
||||
d = [[NSMutableDictionary alloc] init];
|
||||
[d addEntriesFromDictionary: values];
|
||||
[d setObject: uid forKey: @"uid"];
|
||||
|
||||
[[NSDistributedNotificationCenter defaultCenter]
|
||||
postNotificationName: ([fieldName isEqualToString: @"c_defaults"] ? @"SOGoUserDefaultsHaveChanged" : @"SOGoUserSettingsHaveChanged")
|
||||
object: nil
|
||||
userInfo: d];
|
||||
[d release];
|
||||
|
||||
if ([[channel adaptorContext] hasOpenTransaction])
|
||||
{
|
||||
ex = [channel evaluateExpressionX: @"COMMIT TRANSACTION"];
|
||||
@@ -315,6 +321,11 @@ static NSString *uidColumnName = @"c_uid";
|
||||
}
|
||||
|
||||
/* value access */
|
||||
- (void) setValues: (NSDictionary *) theValues
|
||||
{
|
||||
[values removeAllObjects];
|
||||
[values addEntriesFromDictionary: theValues];
|
||||
}
|
||||
|
||||
- (void) setObject: (id) value
|
||||
forKey: (NSString *) key
|
||||
|
||||
Reference in New Issue
Block a user