From 4f25d861b8aaa5bf53d5ae2def86557927afa7cd Mon Sep 17 00:00:00 2001 From: wolfgang Date: Mon, 23 Jul 2007 14:11:49 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1118 d1b88da0-ebda-0310-925b-ed51d893ca5b --- 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 67869825..f6486993 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 5799e82d..4fb12e88 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 -- 2.39.5