+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
@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;
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
- (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;
[[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 {
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;
}
- (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:
@"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
}
}
-+ (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
#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];
#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];
}
+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)
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;
# version file
-SUBMINOR_VERSION:=22
+SUBMINOR_VERSION:=23
+
+# v4.5.23 requires libNGObjWeb v4.5.263
}
- (BOOL)_setupRoot {
- BOOL isDir;
- NSString *p;
+ BOOL isDir;
/* setup root path */
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) {
/* 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];