See ChangeLog

Monotone-Parent: 3e3f539c1798ad054238bb1eb3099675124b888b
Monotone-Revision: 57dd1ad4053d9e7949e68a06c4f52bd1ec44d9d1

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-05-19T23:31:51
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle 2009-05-19 23:31:51 +00:00
parent d7bcd8d2da
commit 13cc138afc
3 changed files with 40 additions and 5 deletions

View file

@ -1,3 +1,18 @@
2009-05-19 Francis Lachapelle <flachapelle@inverse.ca>
* SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount
-allFolderPaths]): if the user default "showSubscribedFoldersOnly"
is not defined for the user, use the application default
"SOGoMailShowSubscribedFoldersOnly".
* UI/PreferencesUI/UIxPreferences.m ([UIxPreferences
-showSubscribedFoldersOnly]): return the user default or the
application default if not defined.
([UIxPreferences-setShowSubscribedFoldersOnly]): when false, set
the user default parameter "showSubscribedFoldersOnly" to NO
instead of removing the entry. This will ensure user defaults are
taking precedence over application defaults.
2009-05-15 Francis Lachapelle <flachapelle@inverse.ca> 2009-05-15 Francis Lachapelle <flachapelle@inverse.ca>
* SOPE/sope-ldap/NGLdap/NGLdapConnection.m: added methods * SOPE/sope-ldap/NGLdap/NGLdapConnection.m: added methods

View file

@ -57,7 +57,7 @@ static NSString *sentFolderName = nil;
static NSString *trashFolderName = nil; static NSString *trashFolderName = nil;
static NSString *sharedFolderName = @""; // TODO: add English default static NSString *sharedFolderName = @""; // TODO: add English default
static NSString *otherUsersFolderName = @""; // TODO: add English default static NSString *otherUsersFolderName = @""; // TODO: add English default
static BOOL defaultShowSubscribedFoldersOnly = NO;
// this is temporary, until we allow users to manage their own accounts // this is temporary, until we allow users to manage their own accounts
static NSString *fallbackIMAP4Server = nil; static NSString *fallbackIMAP4Server = nil;
@ -109,6 +109,8 @@ static NSString *fallbackIMAP4Server = nil;
else else
fallbackIMAP4Server = @"localhost"; fallbackIMAP4Server = @"localhost";
} }
defaultShowSubscribedFoldersOnly = [ud boolForKey: @"SOGoMailShowSubscribedFoldersOnly"];
} }
- (id) init - (id) init
@ -209,10 +211,16 @@ static NSString *fallbackIMAP4Server = nil;
NSMutableArray *folderPaths; NSMutableArray *folderPaths;
NSArray *rawFolders, *mainFolders; NSArray *rawFolders, *mainFolders;
NSUserDefaults *ud; NSUserDefaults *ud;
NSString *showSubscribedFoldersOnly;
ud = [[context activeUser] userDefaults]; ud = [[context activeUser] userDefaults];
showSubscribedFoldersOnly = [ud stringForKey: @"showSubscribedFoldersOnly"];
if (showSubscribedFoldersOnly)
rawFolders = [[self imap4Connection] allFoldersForURL: [self imap4URL] rawFolders = [[self imap4Connection] allFoldersForURL: [self imap4URL]
onlySubscribedFolders: [ud boolForKey: @"showSubscribedFoldersOnly"]]; onlySubscribedFolders: [showSubscribedFoldersOnly boolValue]];
else
rawFolders = [[self imap4Connection] allFoldersForURL: [self imap4URL]
onlySubscribedFolders: defaultShowSubscribedFoldersOnly];
mainFolders = [[NSArray arrayWithObjects: mainFolders = [[NSArray arrayWithObjects:
[self inboxFolderNameInContext: context], [self inboxFolderNameInContext: context],

View file

@ -46,6 +46,7 @@
static BOOL defaultsRead = NO; static BOOL defaultsRead = NO;
static BOOL shouldDisplayPasswordChange = NO; static BOOL shouldDisplayPasswordChange = NO;
static BOOL shouldDisplayAdditionalPreferences = NO; static BOOL shouldDisplayAdditionalPreferences = NO;
static BOOL defaultShowSubscribedFoldersOnly = NO;
@implementation UIxPreferences @implementation UIxPreferences
@ -60,6 +61,8 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
= [ud boolForKey: @"SOGoUIxUserCanChangePassword"]; = [ud boolForKey: @"SOGoUIxUserCanChangePassword"];
shouldDisplayAdditionalPreferences shouldDisplayAdditionalPreferences
= [ud boolForKey: @"SOGoUIxAdditionalPreferences"]; = [ud boolForKey: @"SOGoUIxAdditionalPreferences"];
defaultShowSubscribedFoldersOnly
= [ud boolForKey: @"SOGoMailShowSubscribedFoldersOnly"];
defaultsRead = YES; defaultsRead = YES;
} }
} }
@ -452,12 +455,21 @@ static BOOL shouldDisplayAdditionalPreferences = NO;
if (showSubscribedFoldersOnly) if (showSubscribedFoldersOnly)
[userDefaults setBool: YES forKey: @"showSubscribedFoldersOnly"]; [userDefaults setBool: YES forKey: @"showSubscribedFoldersOnly"];
else else
[userDefaults removeObjectForKey: @"showSubscribedFoldersOnly"]; [userDefaults setBool: NO forKey: @"showSubscribedFoldersOnly"];
} }
- (BOOL) showSubscribedFoldersOnly - (BOOL) showSubscribedFoldersOnly
{ {
return [userDefaults boolForKey: @"showSubscribedFoldersOnly"]; NSString *showSubscribedFoldersOnly;
BOOL r;
showSubscribedFoldersOnly = [userDefaults stringForKey: @"showSubscribedFoldersOnly"];
if (showSubscribedFoldersOnly)
r = [showSubscribedFoldersOnly boolValue];
else
r = defaultShowSubscribedFoldersOnly;
return r;
} }
- (NSArray *) messageCheckList - (NSArray *) messageCheckList