From 7e22621cf3046ceb8d417a6bfa9469f2d18b502a Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 23 Jul 2007 14:11:26 +0000 Subject: [PATCH] Monotone-Parent: b65579776953326ae0dd65da2a1d59cacda222cd Monotone-Revision: 8b6f603129f482aecde7edceba94520c3b955ddb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-07-23T14:11:26 Monotone-Branch: ca.inverse.sogo --- UI/MainUI/SOGoUserHomePage.m | 11 ++++++----- UI/PreferencesUI/UIxPreferences.m | 11 ++++++++--- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/UI/MainUI/SOGoUserHomePage.m b/UI/MainUI/SOGoUserHomePage.m index 678698256..f64869933 100644 --- a/UI/MainUI/SOGoUserHomePage.m +++ b/UI/MainUI/SOGoUserHomePage.m @@ -36,7 +36,7 @@ #import #import -static NSString *defaultModule; +static NSString *defaultModule = nil; @interface SOGoUserHomePage : UIxComponent @@ -48,10 +48,10 @@ static NSString *defaultModule; { NSUserDefaults *ud; - ud = [NSUserDefaults standardUserDefaults]; - defaultModule = [ud stringForKey: @"SOGoUIxDefaultModule"]; - if (defaultModule) + if (!defaultModule) { + ud = [NSUserDefaults standardUserDefaults]; + defaultModule = [ud stringForKey: @"SOGoUIxDefaultModule"]; if (defaultModule) { if (!([defaultModule isEqualToString: @"Calendar"] @@ -62,10 +62,11 @@ static NSString *defaultModule; @"'Calendar', 'Contacts' or Mail)", defaultModule]; defaultModule = @"Calendar"; } + else + defaultModule = @"Calendar"; } else defaultModule = @"Calendar"; - [self logWithFormat: @"default module set to '%@'", defaultModule]; [defaultModule retain]; } diff --git a/UI/PreferencesUI/UIxPreferences.m b/UI/PreferencesUI/UIxPreferences.m index 5799e82dc..4fb12e88d 100644 --- a/UI/PreferencesUI/UIxPreferences.m +++ b/UI/PreferencesUI/UIxPreferences.m @@ -40,6 +40,7 @@ workweek = from -> to identities */ +static BOOL defaultsRead = NO; static BOOL shouldDisplayPasswordChange = NO; @implementation UIxPreferences @@ -48,9 +49,13 @@ static BOOL shouldDisplayPasswordChange = NO; { NSUserDefaults *ud; - ud = [NSUserDefaults standardUserDefaults]; - shouldDisplayPasswordChange - = [ud boolForKey: @"SOGoUIxUserCanChangePassword"]; + if (!defaultsRead) + { + ud = [NSUserDefaults standardUserDefaults]; + shouldDisplayPasswordChange + = [ud boolForKey: @"SOGoUIxUserCanChangePassword"]; + defaultsRead = YES; + } } - (id) init