From: helge Date: Wed, 5 Oct 2005 16:39:20 +0000 (+0000) Subject: moved setup of some defaults X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56f095d6297767ed0cffb21a386bdc7dda9ae786;p=sope moved setup of some defaults git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1162 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/NGObjWeb/ChangeLog b/sope-appserver/NGObjWeb/ChangeLog index 4ae72567..f5e8b5a8 100644 --- a/sope-appserver/NGObjWeb/ChangeLog +++ b/sope-appserver/NGObjWeb/ChangeLog @@ -1,3 +1,8 @@ +2005-10-05 Helge Hess + + * DynamicElements/WOCompoundElement.m: setup defaults in +initialize + (v4.5.207) + 2005-10-05 Helge Hess * DynamicElements/WORadioButtonList.m: changed handling of 'disabled' diff --git a/sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m b/sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m index 0b1a5634..6790c2dc 100644 --- a/sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m +++ b/sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m @@ -35,11 +35,42 @@ @implementation WOCompoundElement #ifdef DEBUG -static int profElements = -1; +static int profElements = -1; +static int embedInPool = -1; +static int logId = -1; static Class NSDateClass = Nil; #endif static int descriptiveIDs = -1; ++ (void)initialize { + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + + if (descriptiveIDs == -1) { + descriptiveIDs = + [[ud objectForKey:@"WODescriptiveElementIDs"] boolValue] ? 1 : 0; + } + +#if DEBUG + if (profElements == -1) { + profElements = [[[NSUserDefaults standardUserDefaults] + objectForKey:@"WOProfileElements"] + boolValue] ? 1 : 0; + } + if (embedInPool == -1) { + embedInPool = [[[NSUserDefaults standardUserDefaults] + objectForKey:@"WOCompoundElementPool"] + boolValue] ? 1 : 0; + NSLog(@"WOCompoundElement: pool embedding is on."); + } + if (logId == -1) { + logId = [[[NSUserDefaults standardUserDefaults] + objectForKey:@"WOCompoundElementLogID"] + boolValue] ? 1 : 0; + NSLog(@"WOCompoundElement: id logging is on."); + } +#endif +} + + (id)allocForCount:(int)_count zone:(NSZone *)_zone { return NSAllocateObject(self, _count * sizeof(WOElement *), _zone); } @@ -56,13 +87,6 @@ static int descriptiveIDs = -1; self = [super init]; - if (descriptiveIDs == -1) { - descriptiveIDs = - [[[NSUserDefaults standardUserDefaults] - objectForKey:@"WODescriptiveElementIDs"] - boolValue] ? 1 : 0; - } - objAtIdx = (void *)[_children methodForSelector: @selector(objectAtIndex:)]; NSAssert1(objAtIdx != NULL, @@ -184,30 +208,10 @@ static int descriptiveIDs = -1; static NSString *cName = @"componentName"; static NSString *elemId = @"elementID"; #endif - static int embedInPool = -1; - static int logId = -1; NSTimeInterval st = 0.0; - + if (NSDateClass == Nil) NSDateClass = [NSDate class]; - - if (profElements == -1) { - profElements = [[[NSUserDefaults standardUserDefaults] - objectForKey:@"WOProfileElements"] - boolValue] ? 1 : 0; - } - if (embedInPool == -1) { - embedInPool = [[[NSUserDefaults standardUserDefaults] - objectForKey:@"WOCompoundElementPool"] - boolValue] ? 1 : 0; - NSLog(@"WOCompoundElement: pool embedding is on."); - } - if (logId == -1) { - logId = [[[NSUserDefaults standardUserDefaults] - objectForKey:@"WOCompoundElementLogID"] - boolValue] ? 1 : 0; - NSLog(@"WOCompoundElement: id logging is on."); - } #endif depth++; diff --git a/sope-appserver/NGObjWeb/Version b/sope-appserver/NGObjWeb/Version index 67c4ebe6..65b1a9f8 100644 --- a/sope-appserver/NGObjWeb/Version +++ b/sope-appserver/NGObjWeb/Version @@ -1,6 +1,6 @@ # version file -SUBMINOR_VERSION:=206 +SUBMINOR_VERSION:=207 # v4.5.122 requires libNGExtensions v4.5.153 # v4.5.91 requires libNGExtensions v4.5.134