/*
- Copyright (C) 2000-2003 SKYRIX Software AG
+ Copyright (C) 2000-2004 SKYRIX Software AG
- This file is part of OGo
+ This file is part of OpenGroupware.org.
OGo is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id: sope.m 4 2004-08-20 17:04:31Z helge $
#include "SoObjects/SoApplication.h"
@implementation SOPE
+static BOOL debugRootObject = NO;
+
+ (void)initialize {
/*
Since we are a tool, we have no bundle and need to declare security info
- (OFSFolder *)rootObjectInContext:(id)_ctx {
OFSFactoryContext *ctx;
OFSFolder *root;
+
+ if (debugRootObject) [self logWithFormat:@"queried root object ..."];
- if ((root = [_ctx valueForKey:SoRootFolder]))
+ if ((root = [_ctx valueForKey:SoRootFolder]) != nil) {
+ if (debugRootObject)
+ [self logWithFormat:@" using cached root object: %@", root];
return root;
+ }
ctx = [OFSFactoryContext contextWithFileManager:[self fileManager]
storagePath:[self rootPath]];
- root = [[OFSFolder alloc] init];
+ root = [[[OFSFolder alloc] init] autorelease];
[root takeStorageInfoFromContext:ctx];
[root awakeFromFetchInContext:ctx];
[_ctx takeValue:root forKey:SoRootFolder];
- return [root autorelease];
+ if (debugRootObject)
+ [self logWithFormat:@" created new root object: %@", root];
+ return root;
}
/* security */