From: helge Date: Mon, 3 Oct 2005 21:27:47 +0000 (+0000) Subject: improvs X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54a5ef10ee5d0e71e8abc9ecf8e757629722f8d7;p=sope improvs git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1149 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-core/EOCoreData/ChangeLog b/sope-core/EOCoreData/ChangeLog index d5095565..292dd9e4 100644 --- a/sope-core/EOCoreData/ChangeLog +++ b/sope-core/EOCoreData/ChangeLog @@ -1,5 +1,13 @@ 2005-10-03 Helge Hess + * v4.5.11 + + * EOFetchSpecification+CoreData.m: only transfer limit to + NSFetchRequest if its != 0 + + * EOCompoundQualifiers.m: added support for qualifier=>predicate + conversion + * improved qualifier=>predicate conversion support (v4.5.10) 2005-08-23 Helge Hess diff --git a/sope-core/EOCoreData/EOCompoundQualifiers.m b/sope-core/EOCoreData/EOCompoundQualifiers.m index ffb07918..5ba98603 100644 --- a/sope-core/EOCoreData/EOCompoundQualifiers.m +++ b/sope-core/EOCoreData/EOCompoundQualifiers.m @@ -31,13 +31,16 @@ } - (NSPredicate *)asPredicate { - NSLog(@"TODO(%s): implement me for class %@!", __PRETTY_FUNCTION__, - NSStringFromClass([self class])); - return nil; + NSArray *tmp; + + tmp = [self subqualifiers]; + tmp = [tmp valueForKey:@"asPredicate"]; + return [NSCompoundPredicate andPredicateWithSubpredicates:tmp]; } @end /* EOAndQualifier(CoreData) */ + @implementation EOOrQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType { @@ -45,13 +48,16 @@ } - (NSPredicate *)asPredicate { - NSLog(@"TODO(%s): implement me for class %@!", __PRETTY_FUNCTION__, - NSStringFromClass([self class])); - return nil; + NSArray *tmp; + + tmp = [self subqualifiers]; + tmp = [tmp valueForKey:@"asPredicate"]; + return [NSCompoundPredicate orPredicateWithSubpredicates:tmp]; } @end /* EOOrQualifier(CoreData) */ + @implementation EONotQualifier(CoreData) - (NSCompoundPredicateType)compoundPredicateType { diff --git a/sope-core/EOCoreData/EOFetchSpecification+CoreData.m b/sope-core/EOCoreData/EOFetchSpecification+CoreData.m index 9620487a..5ec4631a 100644 --- a/sope-core/EOCoreData/EOFetchSpecification+CoreData.m +++ b/sope-core/EOCoreData/EOFetchSpecification+CoreData.m @@ -99,10 +99,14 @@ - (NSFetchRequest *)fetchRequestWithEntity:(NSEntityDescription *)_entity { NSFetchRequest *fr; + unsigned int limit; fr = [[[NSFetchRequest alloc] init] autorelease]; [fr setEntity:_entity]; - [fr setFetchLimit:[self fetchLimit]]; + + if ((limit = [self fetchLimit]) > 0) + [fr setFetchLimit:limit]; + [fr setPredicate:[[self qualifier] asPredicate]]; [fr setSortDescriptors:[self sortOrderingsAsSortDescriptors]]; return fr; diff --git a/sope-core/EOCoreData/Version b/sope-core/EOCoreData/Version index 5e823793..d4260269 100644 --- a/sope-core/EOCoreData/Version +++ b/sope-core/EOCoreData/Version @@ -1,3 +1,3 @@ # version file -SUBMINOR_VERSION:=10 +SUBMINOR_VERSION:=11