]> err.no Git - sope/commitdiff
moved setup of some defaults
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 5 Oct 2005 16:39:20 +0000 (16:39 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Wed, 5 Oct 2005 16:39:20 +0000 (16:39 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1162 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/DynamicElements/WOCompoundElement.m
sope-appserver/NGObjWeb/Version

index 4ae72567b2729455acfb87c79733bafa9c00f06c..f5e8b5a8cd8dd22374aadc7796553298ca536320 100644 (file)
@@ -1,3 +1,8 @@
+2005-10-05  Helge Hess  <helge.hess@opengroupware.org>
+
+       * DynamicElements/WOCompoundElement.m: setup defaults in +initialize
+         (v4.5.207)
+
 2005-10-05  Helge Hess  <helge.hess@skyrix.com>
 
        * DynamicElements/WORadioButtonList.m: changed handling of 'disabled'
index 0b1a5634d966a7ed451d610e7361e52f43986901..6790c2dc216e81e49bcf6a5ab57ae65f3eef4631 100644 (file)
 @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++;
index 67c4ebe6f618b01ff56a93639122b16dd8e0cc7f..65b1a9f84c1b7c2caa751b79e56855aa782d6785 100644 (file)
@@ -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