diff --git a/ChangeLog b/ChangeLog index 5c8705471..a3ebdf3a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2011-07-26 Wolfgang Sourdeau + * OpenChange/MAPIStoreTable.m (-lookupChild:)): new method that + subclasses must override and that a child object matching the + table type. + * OpenChange/MAPIStoreObject.m (-lookupChild:): removed method as it was too generic. Each subclass has now its own set of specialized methods. diff --git a/OpenChange/MAPIStoreAttachmentTable.m b/OpenChange/MAPIStoreAttachmentTable.m index 5cef83f89..b838b8b69 100644 --- a/OpenChange/MAPIStoreAttachmentTable.m +++ b/OpenChange/MAPIStoreAttachmentTable.m @@ -20,8 +20,15 @@ * Boston, MA 02111-1307, USA. */ +#import "MAPIStoreMessage.h" + #import "MAPIStoreAttachmentTable.h" @implementation MAPIStoreAttachmentTable +- (id) lookupChild: (NSString *) childKey +{ + return [(MAPIStoreMessage *) container lookupAttachment: childKey]; +} + @end diff --git a/OpenChange/MAPIStoreFAIMessageTable.m b/OpenChange/MAPIStoreFAIMessageTable.m index 1fbd5c59f..8c29a8e93 100644 --- a/OpenChange/MAPIStoreFAIMessageTable.m +++ b/OpenChange/MAPIStoreFAIMessageTable.m @@ -57,4 +57,9 @@ static Class MAPIStoreFAIMessageK = Nil; return [(MAPIStoreFolder *) container faiMessageKeys]; } +- (id) lookupChild: (NSString *) childKey +{ + return [(MAPIStoreFolder *) container lookupFAIMessage: childKey]; +} + @end diff --git a/OpenChange/MAPIStoreFolderTable.m b/OpenChange/MAPIStoreFolderTable.m index 053a4d76a..c0a6dbd9b 100644 --- a/OpenChange/MAPIStoreFolderTable.m +++ b/OpenChange/MAPIStoreFolderTable.m @@ -55,6 +55,11 @@ return [self childKeys]; } +- (id) lookupChild: (NSString *) childKey +{ + return [(MAPIStoreMessage *) container lookupFolder: childKey]; +} + - (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property { return nil; diff --git a/OpenChange/MAPIStoreMessageTable.m b/OpenChange/MAPIStoreMessageTable.m index 439482666..dea2eb711 100644 --- a/OpenChange/MAPIStoreMessageTable.m +++ b/OpenChange/MAPIStoreMessageTable.m @@ -39,24 +39,9 @@ [self logWithFormat: @"unimplemented method: %@", NSStringFromSelector (_cmd)]; } -- (MAPIRestrictionState) evaluatePropertyRestriction: (struct mapi_SPropertyRestriction *) res - intoQualifier: (EOQualifier **) qualifier +- (id) lookupChild: (NSString *) childKey { - MAPIRestrictionState rc; - id value; - - value = NSObjectFromMAPISPropValue (&res->lpProp); - switch ((uint32_t) res->ulPropTag) - { - case PR_CHANGE_NUM: - [self warnWithFormat: @"!!!hack pending synchronisation enhancement"]; - rc = MAPIRestrictionStateAlwaysTrue; - break; - default: - rc = [super evaluatePropertyRestriction: res intoQualifier: qualifier]; - } - - return rc; + return [(MAPIStoreFolder *) container lookupMessage: childKey]; } @end diff --git a/OpenChange/MAPIStoreTable.h b/OpenChange/MAPIStoreTable.h index c292982a8..ae2f60d8d 100644 --- a/OpenChange/MAPIStoreTable.h +++ b/OpenChange/MAPIStoreTable.h @@ -84,6 +84,7 @@ typedef enum { - (id) childAtRowID: (uint32_t) rowId forQueryType: (enum table_query_type) queryType; +- (id) lookupChild: (NSString *) childKey; - (void) cleanupCaches; diff --git a/OpenChange/MAPIStoreTable.m b/OpenChange/MAPIStoreTable.m index efc1887e1..0a0106f0a 100644 --- a/OpenChange/MAPIStoreTable.m +++ b/OpenChange/MAPIStoreTable.m @@ -803,7 +803,7 @@ static Class NSDataK, NSStringK; if (queryType == MAPISTORE_PREFILTERED_QUERY || [restrictedChildren containsObject: childKey]) - child = [container lookupChild: childKey]; + child = [self lookupChild: childKey]; } currentChild = child; @@ -818,6 +818,13 @@ static Class NSDataK, NSStringK; return child; } +- (id) lookupChild: (NSString *) childKey +{ + [self subclassResponsibility: _cmd]; + + return nil; +} + - (int) getRow: (struct mapistore_property_data **) dataP withRowID: (uint32_t) rowId andQueryType: (enum table_query_type) queryType