]> err.no Git - sope/blobdiff - sope-appserver/NGObjWeb/WOComponent.m
added some WebDrive WebDAV properties
[sope] / sope-appserver / NGObjWeb / WOComponent.m
index 39a115f71c3d81e8487236c3b3ece41ef59891c8..3dbddd05357520d2d721865f3cf505d54faa9883 100644 (file)
 #include "WOComponentFault.h"
 #include "common.h"
 #include <NGExtensions/NGBundleManager.h>
-#include <EOControl/EOControl.h>
+#import <EOControl/EOControl.h>
+#ifdef MULLE_EO_CONTROL
+#import <EOControl/EOKeyValueUnarchiver.h>
+#endif
 #include <NGExtensions/NSString+Ext.h>
 
 @interface WOContext(ComponentStackCount)
@@ -401,7 +404,7 @@ static inline id _getExtraVar(WOComponent *self, NSString *_key) {
 }
 
 - (id)existingSession {
-  if (self->session)
+  if (self->session != nil)
     return self->session;
   
   if ([[self context] hasSession])
@@ -427,7 +430,7 @@ static inline id _getExtraVar(WOComponent *self, NSString *_key) {
   self->context = _ctx;
 }
 - (WOContext *)context {
-  if (self->context)
+  if (self->context != nil)
     return self->context;
   
   [self debugWithFormat:
@@ -438,7 +441,7 @@ static inline id _getExtraVar(WOComponent *self, NSString *_key) {
     [self errorWithFormat:@"aborting, because ctx is missing !"];
     abort();
   }
-    
+  
   if (self->application == nil)
     self->application = [WOApplication application];
   [self _setContext:[self->application context]];
@@ -1085,7 +1088,7 @@ static inline id _getExtraVar(WOComponent *self, NSString *_key) {
 #if DEBUG && 0
   [self debugWithFormat:@"KVC: accessed the component variable %@", _key];
 #endif
-  if ((value = [self objectForKey:_key]))
+  if ((value = [self objectForKey:_key]) != nil)
     return value;
   
   return nil;
@@ -1095,6 +1098,10 @@ static inline id _getExtraVar(WOComponent *self, NSString *_key) {
 
 - (void)setValue:(id)_value forUndefinedKey:(NSString *)_key {
   // Note: this is not used on libFoundation, insufficient KVC implementation
+
+#if DEBUG && 0
+  [self logWithFormat:@"KVC: set the component variable %@: %@",_key,_value];
+#endif
   
   if (_value == nil) {
 #if 0
@@ -1102,7 +1109,7 @@ static inline id _getExtraVar(WOComponent *self, NSString *_key) {
            @"storing <nil> value in component variable %@", _key];
 #endif
     
-    if ([self->wocVariables objectForKey:_key])
+    if ([self->wocVariables objectForKey:_key] !=  nil)
       [self setObject:nil forKey:_key];
       
     return;
@@ -1117,14 +1124,15 @@ static inline id _getExtraVar(WOComponent *self, NSString *_key) {
     }
   }
 #endif
-  
   [self setObject:_value forKey:_key];
 }
+
 - (id)valueForUndefinedKey:(NSString *)_key {
   // Note: this is not used on libFoundation, insufficient KVC implementation
 #if DEBUG && 0
   [self debugWithFormat:@"KVC: accessed the component variable %@", _key];
 #endif
+  
   return [self objectForKey:_key];
 }