]> err.no Git - sope/commitdiff
added new user defaults registration scheme
authorznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 30 Dec 2006 19:38:00 +0000 (19:38 +0000)
committerznek <znek@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Sat, 30 Dec 2006 19:38:00 +0000 (19:38 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1394 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/NGObjWeb/ChangeLog
sope-appserver/NGObjWeb/NGObjWeb/WOCoreApplication.h
sope-appserver/NGObjWeb/Version
sope-appserver/NGObjWeb/WOApplication.m
sope-appserver/NGObjWeb/WOCoreApplication.m
sope-appserver/SoOFS/ChangeLog
sope-appserver/SoOFS/SoOFS.xcodeproj/project.pbxproj
sope-appserver/SoOFS/Version
sope-appserver/SoOFS/sope.m

index ec222b58918582d5430e12cc4a5eec0a8321a3e5..8f165993436f21f1cece6dc53f1159b9b14a92f2 100644 (file)
@@ -1,3 +1,21 @@
+2006-12-30  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * WOCoreApplication.m: Removed the +_initDefaults class method and
+         instead added a new -registerUserDefaults method which provides a
+         sane hook to alter/extend registration of userDefaults in
+         subclasses. Registration is called very early by -init, though, so
+         subclassers must still act very carefully. Removed the braindead
+         +_initializeClass method, instead moved the proper initialization
+         code into -init.
+
+       * WOCoreApplication.h: exposed -registerUserDefaults to subclassers.
+
+       * WOApplication.m: removed +_initializeWOApp, instead moved
+         initialization code to the proper place in -init (after super has
+         been initialized and user defaults have been set in a proper manner).
+
+       * v4.5.262
+
 2006-12-17  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * DynamicElements/WORepetition.m: fixed another bug when using count
index 785c4086891ae7b6d7aa3b87805a1786a4be142d..98b679d763e652b796cf5644e6fd94c146f33e34 100644 (file)
@@ -113,6 +113,11 @@ int WOWatchDogApplicationMainWithServerDefaults
 
 @interface WOCoreApplication(Defaults)
 
+/* A hook to override/plugin into the registration of user defaults.
+   NOTE: this is called by -init (as the first thing), so be extra cautious
+*/
+- (void)registerUserDefaults;
+
 /* WOAdaptor */
 + (void)setAdaptor:(NSString *)_key;
 + (NSString *)adaptor;
index 149f882bf7e54c226ef79e8882b393969b5f1490..979a97c28b3844f90a2403b73a4a4a71fad93533 100644 (file)
@@ -3,7 +3,7 @@
 ifeq ($(GNUSTEP_HOST_VENDOR),apple) # linker overflow
 SUBMINOR_VERSION:=255
 else
-SUBMINOR_VERSION:=261
+SUBMINOR_VERSION:=262
 endif
 
 # v4.5.234 requires libDOM          v4.5.21
index 529ed16cfcbc9135c8123e69aaf40680b82ea615..8fe5e80c43ee1f2299f76ef842aecc2cce81a700 100644 (file)
 - (id)_loadComponentDefinitionWithName:(NSString *)_name
   language:(NSArray *)_langs;
 - (NSDictionary *)memoryStatistics;
+- (void)_setupSNS;
 @end
 
-static NSRecursiveLock *classLock = nil;
-static NGLogger *perfLogger       = nil;
-static Class NSDateClass = Nil;
-static Class WOTemplateClass = Nil;
-static BOOL  debugOn     = NO;
-static NSString *rapidTurnAroundPath = nil;
+static NSRecursiveLock *classLock           = nil;
+static NGLogger        *perfLogger          = nil;
+static Class           NSDateClass          = Nil;
+static Class           WOTemplateClass      = Nil;
+static BOOL            debugOn              = NO;
+static NSString        *rapidTurnAroundPath = nil;
 
 @interface WOSessionStore(SnStore)
 - (void)performExpirationCheck:(NSTimer *)_timer;
@@ -87,44 +88,6 @@ static NSString *defaultCompRqHandlerClassName = @"WOComponentRequestHandler";
   [[self logger] logWithFormat:@"SNS enabled"];
 }
 
-+ (void)_initializeWOApp {
-  static BOOL isInitialized = NO;
-  NSAutoreleasePool *pool;
-  NSUserDefaults    *ud;
-  NGLoggerManager   *lm;
-
-  if (isInitialized) return;
-
-  isInitialized = YES;
-
-  pool = [[NSAutoreleasePool alloc] init];
-  debugOn = [WOApplication isDebuggingEnabled];
-  if (!debugOn)
-    [[self logger] setLogLevel:NGLogLevelInfo];
-  else
-    NSLog(@"Note: WOApplication debugging is enabled.");
-
-  if (classLock == nil) classLock = [[NSRecursiveLock alloc] init];
-  ud = [NSUserDefaults standardUserDefaults];
-  
-  /* setup SNSConnection */
-  
-  if ([ud boolForKey:@"WOContactSNS"])
-    [self _setupSNS];
-  else
-    [[self logger] logWithFormat:@"SNS support disabled."];
-  
-  NSDateClass = [NSDate class];
-  WOTemplateClass = [WOTemplate class];
-
-  rapidTurnAroundPath   = [[ud stringForKey:@"WOProjectDirectory"] copy];
-
-  lm         = [NGLoggerManager defaultLoggerManager];
-  perfLogger = [lm loggerForDefaultKey:@"WOProfileApplication"];
-
-  [pool release];
-}
-
 /* old license checks */
 
 - (NSCalendarDate *)appExpireDate {
@@ -198,15 +161,15 @@ static NSString *defaultCompRqHandlerClassName = @"WOComponentRequestHandler";
                              lowercaseString] isEqualToString:@"yes"];
       }
       else /* default to flattened if no GNUstep runtime is set */
-       isFlattened = YES;
+        isFlattened = YES;
       
       ppath = [[pi arguments] objectAtIndex:0];
       ppath = [ppath stringByDeletingLastPathComponent]; // del exe-name
       
       if (!isFlattened) {
-       ppath = [ppath stringByDeletingLastPathComponent]; // lib-combo
-       ppath = [ppath stringByDeletingLastPathComponent]; // os
-       ppath = [ppath stringByDeletingLastPathComponent]; // cpu
+        ppath = [ppath stringByDeletingLastPathComponent]; // lib-combo
+        ppath = [ppath stringByDeletingLastPathComponent]; // os
+        ppath = [ppath stringByDeletingLastPathComponent]; // cpu
       }
       if ([ppath hasSuffix:suffix])
         result = ppath;
@@ -247,16 +210,38 @@ static NSString *defaultCompRqHandlerClassName = @"WOComponentRequestHandler";
 }
 
 - (id)initWithName:(NSString *)_name {
-  [WOApplication _initializeWOApp];
-  
   if ((self = [super init]) != nil) {
     NSUserDefaults   *ud;
+    NGLoggerManager  *lm;
     WORequestHandler *rh;
-    NSString *rk;
-    
+    NSString         *rk;
+
     self->name = [_name copy];
+    ud         = [NSUserDefaults standardUserDefaults];
+
+    debugOn = [WOApplication isDebuggingEnabled];
+    if (!debugOn)
+      [[self logger] setLogLevel:NGLogLevelInfo];
+    else
+      [[self logger] logWithFormat:@"WOApplication debugging is enabled."];
+    
+    if (classLock == nil) classLock = [[NSRecursiveLock alloc] init];
+    
+    /* setup SNSConnection */
+    
+    if ([ud boolForKey:@"WOContactSNS"])
+      [self _setupSNS];
+    else
+      [[self logger] logWithFormat:@"SNS support disabled."];
+    
+    NSDateClass         = [NSDate class];
+    WOTemplateClass     = [WOTemplate class];
+    
+    rapidTurnAroundPath = [[ud stringForKey:@"WOProjectDirectory"] copy];
+    
+    lm                  = [NGLoggerManager defaultLoggerManager];
+    perfLogger          = [lm loggerForDefaultKey:@"WOProfileApplication"];
     
-    ud = [NSUserDefaults standardUserDefaults];
     
     [self setPageCacheSize:[ud integerForKey:@"WOPageCacheSize"]];
     [self setPermanentPageCacheSize:
index 5cd183f1931aa740042b180f02155dc78e1eda6c..20ec7c5dd056cd7c42c5b5edf65bb9f943676c22 100644 (file)
@@ -48,10 +48,10 @@ NGObjWeb_DECLARE NSString *WOApplicationDidTerminateNotification =
   @"WOApplicationDidTerminate";
 
 @interface WOCoreApplication(PrivateMethods)
-+ (void)_initDefaults;
 + (id)logger;
 - (NSDictionary *)memoryStatistics;
 - (WOResponse *)handleException:(NSException *)_exc;
++ (NSString *)findNGObjWebResource:(NSString *)_name ofType:(NSString *)_ext;
 @end
 
 #if COCOA_Foundation_LIBRARY || NeXT_Foundation_LIBRARY
@@ -115,29 +115,34 @@ static NSMutableArray *activeApps = nil; // THREAD
   }
 }
 
-+ (void)_initializeClass {
-  /*
-    this must be called in -init, since the environment is not setup
-    properly if this is called first.
-  */
-  static BOOL didInit = NO;
-  NSUserDefaults  *ud;
-  NGLoggerManager *lm;
-  if (didInit) return;
-  didInit = YES;
-  [self _initDefaults];
-
-  lm         = [NGLoggerManager defaultLoggerManager];
-  logger     = [lm loggerForClass:self];
-  perfLogger = [lm loggerForDefaultKey:@"WOProfileApplication"];
-
-  ud               = [NSUserDefaults standardUserDefaults];
-  outputValidateOn = [ud boolForKey:@"WOOutputValidationEnabled"];
-  NSDateClass      = [NSDate class];
+- (void)registerUserDefaults {
+  NSDictionary *owDefaults = nil;
+  NSString     *apath;
+  
+  apath = [[self class] findNGObjWebResource:@"Defaults" ofType:@"plist"];
+  if (apath == nil)
+    [self errorWithFormat:@"Cannot find Defaults.plist resource of "
+                          @"NGObjWeb library!"];
+#if HEAVY_DEBUG
+  else
+    [self debugWithFormat:@"Note: loading default defaults: %@", apath];
+#endif
+  
+  owDefaults = [NSDictionary dictionaryWithContentsOfFile:apath];
+  if (owDefaults) {
+    [[NSUserDefaults standardUserDefaults] registerDefaults:owDefaults];
+#if HEAVY_DEBUG
+    [self debugWithFormat:@"did register NGObjWeb defaults: %@\n%@", 
+                          apath, owDefaults];
+#endif
+  }
+  else {
+    [self errorWithFormat:@"could not load NGObjWeb defaults: '%@'",
+                               apath];
+  }
 }
 
 - (id)init {
-  [[self class] _initializeClass];
 #if COCOA_Foundation_LIBRARY
   /*
     NSKeyBinding Warning: <Application 0xc1f70> was accessed using a capitalized key
@@ -149,7 +154,16 @@ static NSMutableArray *activeApps = nil; // THREAD
 #endif
   
   if ((self = [super init])) {
-    NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+    NSUserDefaults  *ud;
+    NGLoggerManager *lm;
+
+    [self registerUserDefaults];
+    ud               = [NSUserDefaults standardUserDefaults];
+    lm               = [NGLoggerManager defaultLoggerManager];
+    logger           = [lm loggerForClass:[self class]];
+    perfLogger       = [lm loggerForDefaultKey:@"WOProfileApplication"];
+    outputValidateOn = [ud boolForKey:@"WOOutputValidationEnabled"];
+    NSDateClass      = [NSDate class];
 
     [self activateApplication];
     
@@ -744,36 +758,6 @@ static NSMutableArray *activeApps = nil; // THREAD
 #endif
 }
 
-+ (void)_initDefaults {
-  static BOOL didInit = NO;
-  NSDictionary *owDefaults = nil;
-  NSString     *apath;
-  
-  if (didInit) return;
-  didInit = YES;
-  
-  apath = [self findNGObjWebResource:@"Defaults" ofType:@"plist"];
-  if (apath == nil)
-    NSLog(@"ERROR: Cannot find Defaults.plist resource of NGObjWeb library!");
-#if HEAVY_DEBUG
-  else
-    [self debugWithFormat:@"Note: loading default defaults: %@", apath];
-#endif
-  
-  owDefaults = [NSDictionary dictionaryWithContentsOfFile:apath];
-  if (owDefaults) {
-    [[NSUserDefaults standardUserDefaults] registerDefaults:owDefaults];
-#if HEAVY_DEBUG
-    [self debugWithFormat:@"did register NGObjWeb defaults: %@\n%@", 
-            apath, owDefaults];
-#endif
-  }
-  else {
-    [self errorWithFormat:@"could not load NGObjWeb defaults: '%@'",
-           apath];
-  }
-}
-
 + (NSUserDefaults *)userDefaults {
   return [NSUserDefaults standardUserDefaults];
 }
index 2e311672ba7043954de2f410f1dff7dbab82fda5..bdf8b8fb07bd4d4d5772fc63ec134a486bab3139 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-30  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * sope.m: changed to use the new user defaults registration mechanism
+         of WOCoreApplication (v4.5.23)
+
 2006-07-03  Helge Hess  <helge.hess@opengroupware.org>
 
        * use %p for pointer formats, fixed gcc 4.1 warnings (v4.5.22)
index 52e27cbfb2f972f903c014d0e5d0e8ebca4a8204..4daee1d920b5089b8ec2675067e3b484a62a9606 100644 (file)
                ADE806E20789F76900633840 /* SoOFSProduct.m in Sources */ = {isa = PBXBuildFile; fileRef = AD4606EB0789911E00E8C5A3 /* SoOFSProduct.m */; };
 /* End PBXBuildFile section */
 
-/* Begin PBXBuildStyle section */
-               ADD65B6806DA32D6007161CA /* Development */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = NO;
-                               GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "APPLE_RUNTIME=1",
-                                       "NeXT_Foundation_LIBRARY=1",
-                                       "COCOA_Foundation_LIBRARY=1",
-                                       "NeXT_RUNTIME=1",
-                                       "COMPILE_AS_FRAMEWORK=1",
-                                       "DEBUG=1",
-                               );
-                       };
-                       name = Development;
-               };
-               ADD65B6906DA32D6007161CA /* Wrapper */ = {
-                       isa = PBXBuildStyle;
-                       buildSettings = {
-                               COPY_PHASE_STRIP = YES;
-                               DEPLOYMENT_LOCATION = NO;
-                               DEPLOYMENT_POSTPROCESSING = YES;
-                               DSTROOT = /;
-                               DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks/";
-                               FRAMEWORK_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
-                               GCC_ENABLE_FIX_AND_CONTINUE = NO;
-                               GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
-                               GCC_OPTIMIZATION_LEVEL = 3;
-                               GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "APPLE_RUNTIME=1",
-                                       "NeXT_Foundation_LIBRARY=1",
-                                       "COCOA_Foundation_LIBRARY=1",
-                                       "NeXT_RUNTIME=1",
-                                       "COMPILE_AS_FRAMEWORK=1",
-                               );
-                               SKIP_INSTALL = YES;
-                               SYMROOT = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
-                               TEMP_DIR = "$(SYMROOT)/$(PROJECT_NAME).build";
-                               UNSTRIPPED_PRODUCT = NO;
-                               ZERO_LINK = NO;
-                       };
-                       name = Wrapper;
-               };
-/* End PBXBuildStyle section */
-
 /* Begin PBXFileReference section */
                AD013B8706E20AC5000910D8 /* README */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
                AD013C1906E20D18000910D8 /* NGHttp.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NGHttp.framework; path = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks/Wrapper/NGHttp.framework"; sourceTree = "<absolute>"; };
                        );
                        buildRules = (
                        );
-                       buildSettings = {
-                               FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-                               INSTALL_PATH = /usr/local/bin;
-                               OTHER_CFLAGS = "";
-                               OTHER_LDFLAGS = "";
-                               OTHER_REZFLAGS = "";
-                               PRODUCT_NAME = "sope-4.5";
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = (
-                                       "-Wmost",
-                                       "-Wno-four-char-constants",
-                                       "-Wno-unknown-pragmas",
-                               );
-                       };
                        dependencies = (
                        );
                        name = "sope-4.5";
                        );
                        buildRules = (
                        );
-                       buildSettings = {
-                               DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.21;
-                               FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-                               FRAMEWORK_VERSION = A;
-                               GCC_PRECOMPILE_PREFIX_HEADER = YES;
-                               GCC_PREFIX_HEADER = common.h;
-                               GCC_WARN_ALLOW_INCOMPLETE_PROTOCOL = NO;
-                               GCC_WARN_FOUR_CHARACTER_CONSTANTS = NO;
-                               GCC_WARN_UNKNOWN_PRAGMAS = NO;
-                               INFOPLIST_FILE = "SoOFS-Info.plist";
-                               INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
-                               OTHER_CFLAGS = "-DXCODE_BUILD=1";
-                               OTHER_LDFLAGS = (
-                                       "-seg1addr",
-                                       0xC3A00000,
-                                       "-headerpad_max_install_names",
-                               );
-                               OTHER_REZFLAGS = "";
-                               PRODUCT_NAME = SoOFS;
-                               SECTORDER_FLAGS = "";
-                               WARNING_CFLAGS = "-Wmost";
-                       };
                        dependencies = (
                        );
                        name = SoOFS;
                        productName = SoOFS;
                        productReference = ADD65D5806DA372D007161CA /* SoOFS.framework */;
-                       productSettingsXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
-<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
-<plist version=\"1.0\">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>English</string>
-       <key>CFBundleExecutable</key>
-       <string>SoOFS</string>
-       <key>CFBundleIdentifier</key>
-       <string>org.OpenGroupware.SOPE.SoOFS</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundlePackageType</key>
-       <string>FMWK</string>
-       <key>CFBundleSignature</key>
-       <string>????</string>
-       <key>CFBundleVersion</key>
-       <string>1.0</string>
-</dict>
-</plist>
-";
                        productType = "com.apple.product-type.framework";
                };
 /* End PBXNativeTarget section */
                ADD65B6A06DA32D6007161CA /* Project object */ = {
                        isa = PBXProject;
                        buildConfigurationList = ADA079A5085738F100993825 /* Build configuration list for PBXProject "SoOFS" */;
-                       buildSettings = {
-                       };
-                       buildStyles = (
-                               ADD65B6806DA32D6007161CA /* Development */,
-                               ADD65B6906DA32D6007161CA /* Wrapper */,
-                       );
                        hasScannedForEncodings = 0;
                        mainGroup = ADD65B6606DA32D6007161CA;
                        productRefGroup = ADD65D5906DA372D007161CA /* Products */;
                        buildSettings = {
                                COPY_PHASE_STRIP = NO;
                                DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.21;
+                               DYLIB_CURRENT_VERSION = 4.5.23;
                                FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
                                FRAMEWORK_VERSION = A;
                                GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
                                DEPLOYMENT_POSTPROCESSING = YES;
                                DSTROOT = /;
                                DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.21;
+                               DYLIB_CURRENT_VERSION = 4.5.23;
                                DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks/";
                                FRAMEWORK_SEARCH_PATHS = "$(USER_LIBRARY_DIR)/EmbeddedFrameworks";
                                FRAMEWORK_VERSION = A;
                        isa = XCBuildConfiguration;
                        buildSettings = {
                                DYLIB_COMPATIBILITY_VERSION = 1;
-                               DYLIB_CURRENT_VERSION = 4.5.21;
+                               DYLIB_CURRENT_VERSION = 4.5.23;
                                FRAMEWORK_SEARCH_PATHS = "$(LOCAL_LIBRARY_DIR)/Frameworks";
                                FRAMEWORK_VERSION = A;
                                GCC_PRECOMPILE_PREFIX_HEADER = YES;
index 6cc7ab753bff8515a8a7457fb4ad788a7caac9db..d8df2f55b842dbcbc35eb623ef1e2f47d4c66113 100644 (file)
@@ -1,3 +1,5 @@
 # version file
 
-SUBMINOR_VERSION:=22
+SUBMINOR_VERSION:=23
+
+# v4.5.23 requires libNGObjWeb v4.5.263
index 30add8671f7335b66200367c111a28d8edaab4b6..ba559bf37c397ec55aec826f1700d02287474af7 100644 (file)
@@ -89,8 +89,7 @@ static BOOL debugRootObject = NO;
 }
 
 - (BOOL)_setupRoot {
-  BOOL     isDir;
-  NSString *p;
+  BOOL isDir;
 
   /* setup root path */
   
@@ -105,7 +104,7 @@ static BOOL debugRootObject = NO;
 
   if (![self->fm fileExistsAtPath:self->rootPath isDirectory:&isDir]) {
     [self logWithFormat:@"SOPE storage root-path does not exist: %@", 
-            self->rootPath];
+                        self->rootPath];
     return NO;
   }
   if (!isDir) {
@@ -122,27 +121,37 @@ static BOOL debugRootObject = NO;
   /* configure */
   
   [self logWithFormat:@"starting SOPE on OFS root: %@", self->rootPath];
-  
+
+  return YES;
+}
+
+- (void)registerUserDefaults {
+  NSString *p;
+
+  [super registerUserDefaults];
   p = [self->rootPath stringByAppendingPathComponent:@".sope.plist"];
   if ([self->fm isReadableFileAtPath:p])
     [self loadLocalDefaults:p];
-  
-  return YES;
 }
 
 - (id)init {
-  if ((self = [super init])) {
-    // TODO: make root-path/fm configurable ?
-    self->fm       = [[NSFileManager defaultManager] retain];
-    self->rootPath = [[self->fm currentDirectoryPath] copy];
-
-    if (![self _setupRoot]) {
-      [self release];
-      return nil;
-    }
+  // TODO: make root-path/fm configurable ?
+  self->fm       = [[NSFileManager defaultManager] retain];
+  self->rootPath = [[self->fm currentDirectoryPath] copy];
+
+  if (![self _setupRoot]) {
+    [self release];
+    return nil;
   }
+  /* Q: Why is [super init] done so goddamn late?
+     A: In the process of setting up or root directory, we're also registering
+        defaults. These defaults are important for the inits done by super,
+        so we need to do this in advance.
+  */
+  [super init];
   return self;
 }
+
 - (void)dealloc {
   [self->fm       release];
   [self->rootPath release];