]> err.no Git - sope/commitdiff
improvs to EOKeyValueQualifier
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 3 Oct 2005 19:17:06 +0000 (19:17 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 3 Oct 2005 19:17:06 +0000 (19:17 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1147 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-core/EOControl/ChangeLog
sope-core/EOControl/EOKeyValueQualifier.m
sope-core/EOControl/Version

index 1a1fdbc952f3845d3d826b188606d32813db7150..a64d451592bf2518fe763d5116ae3fc9c6e069f8 100644 (file)
@@ -1,3 +1,9 @@
+2005-10-03  Helge Hess  <helge.hess@opengroupware.org>
+
+       * EOKeyValueQualifier.m: improved -description in edge conditions,
+         added warnings if the qualifier is initialized with insufficient
+         values (v4.5.61)
+
 2005-08-23  Helge Hess  <helge.hess@opengroupware.org>
 
        * EOQualifier.m: added NSCopying (v4.5.60)
index fd19cf622a956f0d2d5437cd7c0327ce65162a90..29f67c32295f9a0493324bf58248b94037e0512c 100644 (file)
@@ -46,9 +46,19 @@ static EONull *null = nil;
   self->key      = [_key   copyWithZone:NULL];
   self->value    = [_value retain];
   self->operator = _selector;
+  
+  if (_selector == nil) {
+    NSLog(@"WARNING(%s): got no selector for kv qualifier (key=%@)", 
+         __PRETTY_FUNCTION__, _key);
+  }
+  
   return self;
 }
 
+- (id)init {
+  return [self initWithKey:nil operatorSelector:NULL value:nil];
+}
+
 - (void)dealloc {
   [self->key   release];
   [self->value release];
@@ -201,6 +211,12 @@ static EONull *null = nil;
   self->key   = [[_coder decodeObject] copyWithZone:[self zone]];
   self->value = [[_coder decodeObject] retain];
   [_coder decodeValueOfObjCType:@encode(SEL) at:&(self->operator)];
+
+  if (self->operator == nil) {
+    NSLog(@"WARNING(%s): decoded no selector for kv qualifier (key=%@)", 
+         __PRETTY_FUNCTION__, self->key);
+  }
+  
   return self;
 }
 
@@ -261,6 +277,18 @@ static EONull *null = nil;
     }
     else if ((s = [_unarchiver decodeObjectForKey:@"selector"]) != nil)
       self->operator = NSSelectorFromString(s);
+    else {
+      NSLog(@"WARNING(%s): decoded no selector/selectorName for kv qualifier "
+           @"(key=%@)", 
+           __PRETTY_FUNCTION__, self->key);
+      self->operator = EOQualifierOperatorEqual;
+    }
+    
+    if (self->operator == nil) {
+      NSLog(@"WARNING(%s): decoded no selector for kv qualifier (key=%@)", 
+           __PRETTY_FUNCTION__, self->key);
+      self->operator = EOQualifierOperatorEqual;
+    }
   }
   return self;
 }
@@ -281,13 +309,30 @@ static EONull *null = nil;
 
 - (NSString *)description {
   NSMutableString *s;
+  NSString *tmp;
   
   s = [NSMutableString stringWithCapacity:64];
-  [s appendString:self->key];
+  
+  if (self->key != nil)
+    [s appendString:self->key];
+  else
+    [s appendString:@"[NO KEY]"];
+  
   [s appendString:@" "];
-  [s appendString:[EOQualifier stringForOperatorSelector:self->operator]];
+  
+  if ((tmp = [EOQualifier stringForOperatorSelector:self->operator]) != nil)
+    [s appendString:tmp];
+  else if (self->operator != nil)
+    [s appendString:@"[NO STR OPERATOR]"];
+  else
+    [s appendString:@"[NO OPERATOR]"];
+    
   [s appendString:@" "];
-  [s appendString:[self->value qualifierDescription]];
+  
+  if ((tmp = [self->value qualifierDescription]) != nil)
+    [s appendString:tmp];
+  else
+    [s appendString:@"nil"];
   return s;
 }
 
index 7fbe8ee140e3623022ccc65103109611c7a3231a..9846aa8db05721ef7bf9a4da045b7975d2286ffb 100644 (file)
@@ -1,3 +1,3 @@
 # version file
 
-SUBMINOR_VERSION:=60
+SUBMINOR_VERSION:=61