From 4359d943fe7900101b65f156e76743ab76fb3a98 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 2 Dec 2009 21:18:22 +0000 Subject: [PATCH] Monotone-Parent: e5c0dcb0589437eaceeabfaf2552be656e7a33c8 Monotone-Revision: 730c8a73525c070f1f66243a9c692f2ee0adbcd0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-12-02T21:18:22 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoUserDefaults.m | 11 ++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08f86c542..31f385538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-12-02 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoUserDefaults.m (+initialize): we need to + initialize the profile class from the constructor as this method + may be invoked before all modules are loaded. + * SoObjects/SOGo/SOGoSource.h: added new "SOGoDNSource" protocol as a child protocol of "SOGoSource". diff --git a/SoObjects/SOGo/SOGoUserDefaults.m b/SoObjects/SOGo/SOGoUserDefaults.m index 9506d3549..6fa8f8ec8 100644 --- a/SoObjects/SOGo/SOGoUserDefaults.m +++ b/SoObjects/SOGo/SOGoUserDefaults.m @@ -32,7 +32,6 @@ #import "SOGoUserDefaults.h" -static Class SOGoUserProfileKlass = Nil; NSString *SOGoWeekStartJanuary1 = @"January1"; NSString *SOGoWeekStartFirst4DayWeek = @"First4DayWeek"; @@ -45,18 +44,16 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; return @"SOGoSQLUserProfile"; } -+ (void) initialize -{ - if (!SOGoUserProfileKlass) - SOGoUserProfileKlass = NSClassFromString ([self userProfileClassName]); -} - + (SOGoUserDefaults *) defaultsForUser: (NSString *) userId inDomain: (NSString *) domainId { SOGoUserProfile *up; SOGoUserDefaults *ud; SOGoDefaultsSource *parentSource; + static Class SOGoUserProfileKlass = Nil; + + if (!SOGoUserProfileKlass) + SOGoUserProfileKlass = NSClassFromString ([self userProfileClassName]); up = [SOGoUserProfileKlass userProfileWithType: SOGoUserProfileTypeDefaults forUID: userId];