Monotone-Parent: 11407a8d848e4be8f75087c533fb576da5e80ce4

Monotone-Revision: 5901cb55e465d09b6ccf43a331523d24a91ebb01

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-06-20T14:52:40
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-06-20 14:52:40 +00:00
parent bc86f4a582
commit 1a51f75012
2 changed files with 44 additions and 0 deletions

View File

@@ -61,6 +61,9 @@
- (NSString *) calendarColor;
- (void) setCalendarColor: (NSString *) newColor;
- (NSString *) syncTag;
- (void) setSyncTag: (NSString *) newSyncTag;
/* selection */
- (NSArray *) calendarUIDs;

View File

@@ -329,6 +329,47 @@ static Class sogoAppointmentFolderKlass = Nil;
[settings synchronize];
}
- (NSString *) syncTag
{
NSUserDefaults *settings;
NSDictionary *syncTags;
NSString *syncTag;
settings = [[context activeUser] userSettings];
syncTags = [[settings objectForKey: @"Calendar"]
objectForKey: @"FolderSyncTags"];
syncTag = [syncTags objectForKey: [self folderReference]];
if (!syncTag)
syncTag = @"";
return syncTag;
}
#warning this code shares a lot with the colour code
- (void) setSyncTag: (NSString *) newSyncTag
{
NSUserDefaults *settings;
NSMutableDictionary *calendarSettings;
NSMutableDictionary *syncTags;
settings = [[context activeUser] userSettings];
calendarSettings = [settings objectForKey: @"Calendar"];
if (!calendarSettings)
{
calendarSettings = [NSMutableDictionary dictionary];
[settings setObject: calendarSettings
forKey: @"Calendar"];
}
syncTags = [calendarSettings objectForKey: @"FolderSyncTags"];
if (!syncTags)
{
syncTags = [NSMutableDictionary dictionary];
[calendarSettings setObject: syncTags forKey: @"FolderSyncTags"];
}
[syncTags setObject: newSyncTag forKey: [self folderReference]];
[settings synchronize];
}
/* logging */
- (id) debugLogger