From e6e6542d95abb5107f5d022cc206d382ceb5118f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 5 May 2008 23:39:07 +0000 Subject: [PATCH] Monotone-Parent: 40c6f56ac0840b5680cd43b2a9d5ef7d03bd69e2 Monotone-Revision: a969c621c7bdf36505c11f0aaf6e61680e8375f7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-05T23:39:07 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 13 +++++++++++++ SoObjects/Appointments/SOGoAppointmentFolder.m | 18 ++++-------------- UI/Common/UIxFolderActions.m | 8 ++++---- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index e955a197c..1c4530757 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-05-05 Wolfgang Sourdeau + + * UI/Common/UIxFolderActions.m ([UIxFolderActions -activateFolderAction]) + ([UIxFolderActions -deactivateFolderAction]): reversed the logic + and remove or add the folder name from/into the 'InactiveFolders' + settings key. + + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder -create]): no longer write the folder name + in the 'ActiveFolders' settings key. + ([-isActive]): returns whether the folder is NOT listed in the + 'InactiveFolders' settings key. + 2008-05-02 Wolfgang Sourdeau * Main/SOGo.m ([SOGo -davURL], [SOGo -soURL]): copied methods from diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 889e3390e..71c26f1ce 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1573,7 +1573,6 @@ static NSNumber *sharedYes = nil; - (BOOL) create { BOOL rc; - NSMutableArray *folderSubscription; NSUserDefaults *userSettings; NSMutableDictionary *calendarSettings; SOGoUser *ownerUser; @@ -1590,15 +1589,6 @@ static NSNumber *sharedYes = nil; calendarSettings = [NSMutableDictionary dictionary]; [userSettings setObject: calendarSettings forKey: @"Calendar"]; } - folderSubscription - = [calendarSettings objectForKey: @"ActiveFolders"]; - if (!folderSubscription) - { - folderSubscription = [NSMutableArray array]; - [calendarSettings setObject: folderSubscription - forKey: @"ActiveFolders"]; - } - [folderSubscription addObjectUniquely: nameInContainer]; [userSettings synchronize]; } @@ -1953,13 +1943,13 @@ static NSNumber *sharedYes = nil; - (BOOL) isActive { NSUserDefaults *settings; - NSArray *activeFolders; + NSArray *inactiveFolders; settings = [[context activeUser] userSettings]; - activeFolders - = [[settings objectForKey: @"Calendar"] objectForKey: @"ActiveFolders"]; + inactiveFolders + = [[settings objectForKey: @"Calendar"] objectForKey: @"InactiveFolders"]; - return [activeFolders containsObject: nameInContainer]; + return ![inactiveFolders containsObject: nameInContainer]; } @end /* SOGoAppointmentFolder */ diff --git a/UI/Common/UIxFolderActions.m b/UI/Common/UIxFolderActions.m index a2d6f64d1..9fde4a2fe 100644 --- a/UI/Common/UIxFolderActions.m +++ b/UI/Common/UIxFolderActions.m @@ -180,18 +180,18 @@ [self _setupContext]; folderSubscription - = [moduleSettings objectForKey: @"ActiveFolders"]; + = [moduleSettings objectForKey: @"InactiveFolders"]; if (!folderSubscription) { folderSubscription = [NSMutableArray array]; - [moduleSettings setObject: folderSubscription forKey: @"ActiveFolders"]; + [moduleSettings setObject: folderSubscription forKey: @"InactiveFolders"]; } folderName = [clientObject nameInContainer]; if (makeActive) - [folderSubscription addObjectUniquely: folderName]; - else [folderSubscription removeObject: folderName]; + else + [folderSubscription addObjectUniquely: folderName]; [ud synchronize];