[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RFA GDL2 EOQualifier fixes
From: |
David Ayers |
Subject: |
RFA GDL2 EOQualifier fixes |
Date: |
Mon, 10 Feb 2003 18:16:37 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3a) Gecko/20021212 |
Hello everyone,
here are a couple of fixes mostly for in-memory qualifier evaluation.
We're still missing the correct Like and CaseInsensitiveLike
implementations. I'm not sure when I'll get into doing that as I'm
still pretty boged down on the initial gdl2 tests suite submission, so
if anyone out there feels compelled :-)
If no objections come up, I'll commit them in a couple of days.
Cheers,
Dave
* EOControl/EOKeyComparisonQualifier.m
([EOKeyComparisonQualifier -evaluateWithObject:]): adjusted local
variable names and fixed Equal, NotEqual and Contains comparison.
* EOControl/EONotQualifier.m
([EONotQualifier -evaluateWithObject:]): Implemented.
([EONotQualifier -copyWithZone:]): Actually allocate from supplied
zone.
* EOControl/EOOrQualifier.m
([EOOrQualifier -evaluateWithObject:]): Corrected implementation.
* EOControl/EOQualifier.m
([EOQualifier +variableWithKey:]): Corrected implementation.
(getKey(): Replace autorelease with AUTORELEASE().
Index: dev-libs/gdl2/ChangeLog
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/ChangeLog,v
retrieving revision 1.35
diff -u -r1.35 ChangeLog
--- dev-libs/gdl2/ChangeLog 6 Feb 2003 21:18:29 -0000 1.35
+++ dev-libs/gdl2/ChangeLog 10 Feb 2003 17:04:12 -0000
@@ -1,3 +1,18 @@
+2003-02-10 David Ayers <d.ayers@inode.at>
+
+ * EOControl/EOKeyComparisonQualifier.m
+ ([EOKeyComparisonQualifier -evaluateWithObject:]): adjusted local
+ variable names and fixed Equal, NotEqual and Contains comparison.
+ * EOControl/EONotQualifier.m
+ ([EONotQualifier -evaluateWithObject:]): Implemented.
+ ([EONotQualifier -copyWithZone:]): Actually allocate from supplied
+ zone.
+ * EOControl/EOOrQualifier.m
+ ([EOOrQualifier -evaluateWithObject:]): Corrected implementation.
+ * EOControl/EOQualifier.m
+ ([EOQualifier +variableWithKey:]): Corrected implementation.
+ (getKey(): Replace autorelease with AUTORELEASE().
+
2003-02-06 David Ayers <d.ayers@inode.at>
* EOAccess/EOModel.m
Index: dev-libs/gdl2/EOControl/EOKeyComparisonQualifier.m
===================================================================
RCS file:
/cvsroot/gnustep/gnustep/dev-libs/gdl2/EOControl/EOKeyComparisonQualifier.m,v
retrieving revision 1.7
diff -u -r1.7 EOKeyComparisonQualifier.m
--- dev-libs/gdl2/EOControl/EOKeyComparisonQualifier.m 4 Feb 2003 15:16:58
-0000 1.7
+++ dev-libs/gdl2/EOControl/EOKeyComparisonQualifier.m 10 Feb 2003 17:04:13
-0000
@@ -107,51 +107,49 @@
- (BOOL)evaluateWithObject: (id)object
{
- id leftKey, rightKey;
+ id leftVal, rightVal;
- leftKey = [object valueForKey: _leftKey];
- rightKey = [object valueForKey: _rightKey];
+ leftVal = [object valueForKey: _leftKey];
+ rightVal = [object valueForKey: _rightKey];
if (sel_eq(_selector, EOQualifierOperatorEqual) == YES)
{
- return [leftKey isEqual: rightKey] == NSOrderedSame;
+ return [leftVal isEqual: rightVal];
}
else if (sel_eq(_selector, EOQualifierOperatorNotEqual) == YES)
{
- return [leftKey isEqual: rightKey] != NSOrderedSame;
+ return ([leftVal isEqual: rightVal]?NO:YES);
}
else if (sel_eq(_selector, EOQualifierOperatorLessThan) == YES)
{
- return [(NSObject *)leftKey compare: rightKey] == NSOrderedAscending;
+ return [leftVal compare: rightVal] == NSOrderedAscending;
}
else if (sel_eq(_selector, EOQualifierOperatorGreaterThan) == YES)
{
- return [(NSObject *)leftKey compare: rightKey] == NSOrderedDescending;
+ return [leftVal compare: rightVal] == NSOrderedDescending;
}
else if (sel_eq(_selector, EOQualifierOperatorLessThanOrEqualTo) == YES)
{
- return [(NSObject *)leftKey compare: rightKey] != NSOrderedDescending;
+ return [leftVal compare: rightVal] != NSOrderedDescending;
}
else if (sel_eq(_selector, EOQualifierOperatorGreaterThanOrEqualTo) == YES)
{
- return [(NSObject *)leftKey compare: rightKey] != NSOrderedAscending;
+ return [leftVal compare: rightVal] != NSOrderedAscending;
}
else if (sel_eq(_selector, EOQualifierOperatorContains) == YES)
{
- [self notImplemented: _cmd];
-
- return NO;
+ return [leftVal rangeOfString: rightVal].location != NSNotFound;
}
else if (sel_eq(_selector, EOQualifierOperatorLike) == YES)
{
NSEmitTODO(); //TODO
- return [leftKey isEqual: rightKey]
+ return [leftVal isEqual: rightVal]
== NSOrderedSame;
}
else if (sel_eq(_selector, EOQualifierOperatorCaseInsensitiveLike) == YES)
{
NSEmitTODO(); //TODO
- return [[leftKey uppercaseString] isEqual: [rightKey uppercaseString]]
+ return [[leftVal uppercaseString] isEqual: [rightVal uppercaseString]]
== NSOrderedSame;
}
Index: dev-libs/gdl2/EOControl/EONotQualifier.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOControl/EONotQualifier.m,v
retrieving revision 1.5
diff -u -r1.5 EONotQualifier.m
--- dev-libs/gdl2/EOControl/EONotQualifier.m 31 Dec 2002 16:25:10 -0000
1.5
+++ dev-libs/gdl2/EOControl/EONotQualifier.m 10 Feb 2003 17:04:13 -0000
@@ -65,7 +65,7 @@
- (id)copyWithZone: (NSZone *)zone
{
- EONotQualifier *qual = [[EONotQualifier alloc] init];
+ EONotQualifier *qual = [[EONotQualifier allocWithZone: zone] init];
qual->_qualifier = [_qualifier copyWithZone: zone];
@@ -74,9 +74,7 @@
- (BOOL)evaluateWithObject: (id)object
{
- //TODO
- [self notImplemented: _cmd];
- return NO;
+ return ([_qualifier evaluateWithObject: object] ? NO : YES);
}
@end
Index: dev-libs/gdl2/EOControl/EOOrQualifier.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOControl/EOOrQualifier.m,v
retrieving revision 1.6
diff -u -r1.6 EOOrQualifier.m
--- dev-libs/gdl2/EOControl/EOOrQualifier.m 31 Dec 2002 16:25:10 -0000
1.6
+++ dev-libs/gdl2/EOControl/EOOrQualifier.m 10 Feb 2003 17:04:13 -0000
@@ -133,11 +133,11 @@
qualifiersEnum = [_qualifiers objectEnumerator];
while ((qualifier = [qualifiersEnum nextObject]))
{
- if ([qualifier evaluateWithObject: object] == NO)
- return NO;
+ if ([qualifier evaluateWithObject: object] == YES)
+ return YES;
}
- return YES;
+ return NO;
}
- (id) qualifierMigratedFromEntity: (id)param0
Index: dev-libs/gdl2/EOControl/EOQualifier.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOControl/EOQualifier.m,v
retrieving revision 1.8
diff -u -r1.8 EOQualifier.m
--- dev-libs/gdl2/EOControl/EOQualifier.m 4 Feb 2003 15:16:58 -0000
1.8
+++ dev-libs/gdl2/EOControl/EOQualifier.m 10 Feb 2003 17:04:13 -0000
@@ -335,7 +335,8 @@
if (classString)
{
- key = [[[NSClassFromString(classString) alloc] initWithString: key]
autorelease];
+ key = AUTORELEASE([[NSClassFromString(classString) alloc]
+ initWithString: key]);
}
}
@@ -786,7 +787,7 @@
+ (EOQualifierVariable *)variableWithKey: (NSString *)key
{
- return [EOQualifierVariable variableWithKey: key];
+ return AUTORELEASE([[EOQualifierVariable alloc] initWithKey: key]);
}
- (EOQualifierVariable *)initWithKey: (NSString *)key
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- RFA GDL2 EOQualifier fixes,
David Ayers <=