Monotone-Parent: da9c14ddfb4c9a9c929c7b84543af4ce664cfc10

Monotone-Revision: 829ccf73000a2d91a5daf67741479e395011b6a8

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-07-26T20:13:10
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2011-07-26 20:13:10 +00:00
parent b95cd69e4b
commit aad817d5ca
19 changed files with 307 additions and 150 deletions
+13
View File
@@ -9,13 +9,26 @@
* OpenChange/MAPIStoreObject.m (-lookupChild:): removed method as
it was too generic. Each subclass has now its own set of
specialized methods.
(-childKeysMatchingQualiflier:andSortOrderings:) same as above.
* OpenChange/MAPIStoreMessage.m (-lookupAttachment:): new method,
replacing -[MAPIStoreObject lookupChild:].
(-attachmentKeysMatchingQualiflier:andSortOrderings:) same as
above, replacing (-[MAPIStoreObject
childKeysMatchingQualiflier:andSortOrderings:]).
* OpenChange/MAPIStoreFolder.m (-lookupFolder:, -lookupMessage:)
(-lookupFAIMessage:): new methods, replacing -[MAPIStoreObject
lookupChild:].
(-messageKeysMatchingQualiflier:andSortOrderings:) same as
above, replacing (-[MAPIStoreObject
childKeysMatchingQualiflier:andSortOrderings:]).
(-faiMessageKeysMatchingQualiflier:andSortOrderings:) same as
above, replacing (-[MAPIStoreObject
childKeysMatchingQualiflier:andSortOrderings:]).
(-folderKeysMatchingQualiflier:andSortOrderings:) same as
above, replacing (-[MAPIStoreObject
childKeysMatchingQualiflier:andSortOrderings:]).
2011-07-26 Francis Lachapelle <flachapelle@inverse.ca>
+39
View File
@@ -20,12 +20,51 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import "MAPIStoreMessage.h"
#import "MAPIStoreAttachmentTable.h"
@implementation MAPIStoreAttachmentTable
- (NSArray *) childKeys
{
if (!childKeys)
{
childKeys = [(MAPIStoreMessage *)
container attachmentKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [(MAPIStoreMessage *)
container attachmentKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (id) lookupChild: (NSString *) childKey
{
return [(MAPIStoreMessage *) container lookupAttachment: childKey];
+3 -11
View File
@@ -466,15 +466,6 @@
[sogoObject saveComponent: newEvent];
}
/* TODO: those are stubs meant to prevent OpenChange from crashing when a
recurring event is open */
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
/* TODO: Here we should return recurrence exceptions */
return attachmentKeys;
}
- (id) lookupAttachment: (NSString *) childKey
{
return [attachmentParts objectForKey: childKey];
@@ -486,7 +477,7 @@
uint32_t newAid;
NSString *newKey;
newAid = [attachmentKeys count];
newAid = [[self attachmentKeys] count];
newAttachment = [MAPIStoreCalendarAttachment
mapiStoreObjectWithSOGoObject: nil
@@ -496,7 +487,8 @@
newKey = [NSString stringWithFormat: @"%ul", newAid];
[attachmentParts setObject: newAttachment
forKey: newKey];
[attachmentKeys addObject: newKey];
[attachmentKeys release];
attachmentKeys = nil;
return newAttachment;
}
+3 -13
View File
@@ -45,8 +45,9 @@
{
unsigned int v = MSGFLAG_FROMME;
if ([[self childKeysMatchingQualifier: nil
andSortOrderings: nil] count] > 0)
if ([[self attachmentKeysMatchingQualifier: nil
andSortOrderings: nil]
count] > 0)
v |= MSGFLAG_HASATTACH;
*data = MAPILongValue (memCtx, v);
@@ -172,17 +173,6 @@ e)
return [attachmentParts objectForKey: childKey];
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
if (qualifier)
[self errorWithFormat: @"qualifier is not used for attachments"];
if (sortOrderings)
[self errorWithFormat: @"sort orderings are not used for attachments"];
return attachmentKeys;
}
- (void) submit
{
NSString *msgClass;
+35 -1
View File
@@ -20,6 +20,8 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import "MAPIStoreFAIMessage.h"
#import "MAPIStoreFolder.h"
@@ -54,7 +56,39 @@ static Class MAPIStoreFAIMessageK = Nil;
- (NSArray *) childKeys
{
return [(MAPIStoreFolder *) container faiMessageKeys];
if (!childKeys)
{
childKeys = [(MAPIStoreFolder *)
container faiMessageKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [(MAPIStoreFolder *)
container faiMessageKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (id) lookupChild: (NSString *) childKey
+2 -15
View File
@@ -110,8 +110,8 @@ static Class MAPIStoreFSMessageK;
return newMessage;
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
NSArray *allKeys;
NSMutableArray *keys;
@@ -145,14 +145,6 @@ static Class MAPIStoreFSMessageK;
return keys;
}
- (NSArray *) folderKeys
{
if (!folderKeys)
ASSIGN (folderKeys, [sogoObject toManyRelationshipKeys]);
return folderKeys;
}
- (id) lookupFolder: (NSString *) childKey
{
id childObject = nil;
@@ -170,11 +162,6 @@ static Class MAPIStoreFSMessageK;
return childObject;
}
- (MAPIStoreFAIMessageTable *) folderTable
{
return [MAPIStoreFolderTable tableForContainer: self];
}
- (NSDate *) lastMessageModificationTime
{
NSUInteger count, max;
+4 -4
View File
@@ -142,8 +142,8 @@
return MAPISTORE_SUCCESS;
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
- (NSArray *) attachmentsKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
NSDictionary *attachments;
NSArray *keys;
@@ -170,8 +170,8 @@
fetchedAttachments = YES;
}
return [super childKeysMatchingQualifier: qualifier
andSortOrderings: sortOrderings];
return [super attachmentKeysMatchingQualifier: qualifier
andSortOrderings: sortOrderings];
}
- (void) save
+21 -10
View File
@@ -27,6 +27,7 @@
#import "MAPIStoreTable.h"
@class NSArray;
@class NSMutableArray;
@class NSURL;
@@ -48,7 +49,7 @@
MAPIStoreContext *context;
NSArray *messageKeys;
NSArray *faiMessageKeys;
NSMutableArray *folderKeys;
NSArray *folderKeys;
NSDictionary *properties;
@@ -62,27 +63,31 @@
- (id) initWithURL: (NSURL *) newURL
inContext: (MAPIStoreContext *) newContext;
- (id) lookupFolder: (NSString *) folderKey;
- (id) lookupFolderByURL: (NSString *) folderURL;
- (id) lookupMessage: (NSString *) messageKey;
- (id) lookupFAIMessage: (NSString *) messageKey;
- (id) lookupMessageByURL: (NSString *) messageURL;
- (NSArray *) activeMessageTables;
- (NSArray *) activeFAIMessageTables;
- (MAPIStoreMessageTable *) messageTable;
- (id) lookupMessageByURL: (NSString *) messageURL;
- (id) lookupFolderByURL: (NSString *) folderURL;
/* message objects and tables */
- (id) lookupMessage: (NSString *) messageKey;
- (NSArray *) messageKeys;
/* FAI message objects and tables */
- (id) lookupFAIMessage: (NSString *) messageKey;
- (MAPIStoreFAIMessageTable *) faiMessageTable;
- (NSArray *) faiMessageKeys;
- (NSArray *) faiMessageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
/* folder objects and tables */
- (id) lookupFolder: (NSString *) folderKey;
- (MAPIStoreFolderTable *) folderTable;
- (NSArray *) folderKeys;
- (NSArray *) folderKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
- (MAPIStoreMessage *) createMessage: (BOOL) isAssociated;
- (NSString *) createFolder: (struct SRow *) aRow
withFID: (uint64_t) newFID;
/* backend interface */
@@ -116,6 +121,12 @@
/* subclasses */
- (Class) messageClass;
- (MAPIStoreMessage *) createMessage;
- (MAPIStoreMessageTable *) messageTable;
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
- (NSString *) createFolder: (struct SRow *) aRow
withFID: (uint64_t) newFID;
- (NSCalendarDate *) lastMessageModificationTime;
+46 -5
View File
@@ -127,6 +127,9 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
{
urlString = [[self url] stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
propsURL = [NSURL URLWithString: urlString];
ASSIGN (faiFolder,
[SOGoMAPIFSFolder folderWithURL: propsURL
andTableType: MAPISTORE_FAI_TABLE]);
ASSIGN (propsFolder,
[SOGoMAPIFSFolder folderWithURL: propsURL
andTableType: MAPISTORE_FOLDER_TABLE]);
@@ -599,8 +602,8 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
{
if (!messageKeys)
{
messageKeys = [self childKeysMatchingQualifier: nil
andSortOrderings: nil];
messageKeys = [self messageKeysMatchingQualifier: nil
andSortOrderings: nil];
[messageKeys retain];
}
@@ -612,11 +615,23 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return [MAPIStoreFAIMessageTable tableForContainer: self];
}
- (NSArray *) faiMessageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
if (qualifier)
[self errorWithFormat: @"qualifier is not used for FAI messages"];
if (sortOrderings)
[self errorWithFormat: @"sort orderings are not used for FAI messages"];
return [faiFolder toOneRelationshipKeys];
}
- (NSArray *) faiMessageKeys
{
if (!faiMessageKeys)
{
faiMessageKeys = [faiFolder toOneRelationshipKeys];
faiMessageKeys = [self faiMessageKeysMatchingQualifier: nil
andSortOrderings: nil];
[faiMessageKeys retain];
}
@@ -625,12 +640,30 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
- (MAPIStoreFolderTable *) folderTable
{
return nil;
return [MAPIStoreFolderTable tableForContainer: self];
}
- (NSArray *) folderKeys
{
return nil;
if (!folderKeys)
{
folderKeys = [self folderKeysMatchingQualifier: nil
andSortOrderings: nil];
[folderKeys retain];
}
return folderKeys;
}
- (NSArray *) folderKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
if (qualifier)
[self errorWithFormat: @"qualifier is not used for folders"];
if (sortOrderings)
[self errorWithFormat: @"sort orderings are not used for folders"];
return [sogoObject toManyRelationshipKeys];
}
- (NSArray *) activeMessageTables
@@ -886,6 +919,14 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return nil;
}
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
[self subclassResponsibility: _cmd];
return nil;
}
- (Class) messageClass
{
[self subclassResponsibility: _cmd];
+33 -3
View File
@@ -20,6 +20,8 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <NGExtensions/NSObject+Logs.h>
#import "MAPIStoreFolder.h"
@@ -46,18 +48,46 @@
- (NSArray *) childKeys
{
return [(MAPIStoreFolder *) container folderKeys];
if (!childKeys)
{
childKeys = [(MAPIStoreFolder *)
container folderKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
/* FIXME: restrictions are ignored on folder tables */
return [self childKeys];
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [(MAPIStoreFolder *)
container folderKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (id) lookupChild: (NSString *) childKey
{
return [(MAPIStoreMessage *) container lookupFolder: childKey];
return [(MAPIStoreFolder *) container lookupFolder: childKey];
}
- (NSString *) backendIdentifierForProperty: (enum MAPITAGS) property
+2 -2
View File
@@ -38,8 +38,8 @@
@implementation MAPIStoreGCSFolder
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
static NSArray *fields = nil;
NSArray *records;
+16 -13
View File
@@ -199,12 +199,10 @@ static Class SOGoMailFolderK;
return MAPISTORE_SUCCESS;
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
- (EOQualifier *) nonDeletedQualifier
{
NSArray *uidKeys;
EOQualifier *fetchQualifier, *deletedQualifier;
static EOQualifier *nonDeletedQualifier = nil;
EOQualifier *deletedQualifier;
if (!nonDeletedQualifier)
{
@@ -218,18 +216,28 @@ static Class SOGoMailFolderK;
[deletedQualifier release];
}
return nonDeletedQualifier;
}
- (NSArray *) messageKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
NSArray *uidKeys;
EOQualifier *fetchQualifier;
if (!sortOrderings)
sortOrderings = [NSArray arrayWithObject: @"ARRIVAL"];
if (qualifier)
{
fetchQualifier = [[EOAndQualifier alloc]
initWithQualifiers: nonDeletedQualifier, qualifier,
nil];
fetchQualifier
= [[EOAndQualifier alloc] initWithQualifiers:
[self nonDeletedQualifier], qualifier,
nil];
[fetchQualifier autorelease];
}
else
fetchQualifier = nonDeletedQualifier;
fetchQualifier = [self nonDeletedQualifier];
uidKeys = [sogoObject fetchUIDsMatchingQualifier: fetchQualifier
sortOrdering: sortOrderings];
@@ -244,11 +252,6 @@ static Class SOGoMailFolderK;
return folderKeys;
}
- (MAPIStoreFAIMessageTable *) folderTable
{
return [MAPIStoreMailFolderTable tableForContainer: self];
}
- (id) lookupFolder: (NSString *) childKey
{
id childObject = nil;
+9 -15
View File
@@ -104,7 +104,6 @@ static Class NSExceptionK, MAPIStoreSentItemsFolderK, MAPIStoreDraftsFolderK;
headerSetup = NO;
bodyContent = nil;
bodySetup = NO;
fetchedAttachments = NO;
appointmentWrapper = nil;
}
@@ -444,8 +443,8 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
v |= MSGFLAG_FROMME;
if ([flags containsObject: @"seen"])
v |= MSGFLAG_READ;
if ([[self childKeysMatchingQualifier: nil
andSortOrderings: nil] count] > 0)
if ([[self attachmentKeys]
count] > 0)
v |= MSGFLAG_HASATTACH;
*data = MAPILongValue (memCtx, v);
@@ -1122,7 +1121,6 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
keyPrefix = @"0";
[attachmentParts setObject: bodyInfo
forKey: keyPrefix];
[attachmentKeys addObject: keyPrefix];
}
else
{
@@ -1137,18 +1135,14 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
}
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
- (NSArray *) attachmentsKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
if (!fetchedAttachments)
{
[self _fetchAttachmentPartsInBodyInfo: [sogoObject bodyStructure]
withPrefix: @""];
fetchedAttachments = YES;
}
[self _fetchAttachmentPartsInBodyInfo: [sogoObject bodyStructure]
withPrefix: @""];
return [super childKeysMatchingQualifier: qualifier
andSortOrderings: sortOrderings];
return [super attachmentKeysMatchingQualifier: qualifier
andSortOrderings: sortOrderings];
}
- (id) lookupAttachment: (NSString *) childKey
@@ -1186,7 +1180,7 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
mapiStoreObjectWithSOGoObject: currentPart
inContainer: self];
[attachment setBodyInfo: [attachmentParts objectForKey: childKey]];
[attachment setAID: [attachmentKeys indexOfObject: childKey]];
[attachment setAID: [[self attachmentKeys] indexOfObject: childKey]];
}
}
+7 -1
View File
@@ -25,9 +25,12 @@
#import <Foundation/NSObject.h>
@class NSArray;
@class NSMutableArray;
@class NSMutableDictionary;
@class EOQualifier;
@class MAPIStoreAttachment;
@class MAPIStoreAttachmentTable;
@class MAPIStoreFolder;
@@ -36,7 +39,7 @@
@interface MAPIStoreMessage : MAPIStoreObject
{
NSMutableArray *attachmentKeys;
NSArray *attachmentKeys;
NSMutableDictionary *attachmentParts;
NSMutableArray *activeTables;
}
@@ -46,6 +49,9 @@
- (int) modifyRecipientsWithRows: (struct ModifyRecipientRow *) rows
andCount: (NSUInteger) max;
- (NSArray *) attachmentKeys;
- (NSArray *) attachmentKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
- (id) lookupAttachment: (NSString *) childKey;
/* backend methods */
+21 -13
View File
@@ -60,7 +60,6 @@
{
if ((self = [super init]))
{
attachmentKeys = [NSMutableArray new];
attachmentParts = [NSMutableDictionary new];
activeTables = [NSMutableArray new];
}
@@ -238,7 +237,7 @@
uint32_t newAid;
NSString *newKey;
newAid = [attachmentKeys count];
newAid = [[self attachmentKeys] count];
newAttachment = [MAPIStoreAttachment
mapiStoreObjectWithSOGoObject: nil
@@ -248,7 +247,8 @@
newKey = [NSString stringWithFormat: @"%ul", newAid];
[attachmentParts setObject: newAttachment
forKey: newKey];
[attachmentKeys addObject: newKey];
[attachmentKeys release];
attachmentKeys = nil;
return newAttachment;
}
@@ -285,8 +285,7 @@
NSArray *keys;
int rc = MAPISTORE_ERR_NOT_FOUND;
keys = [self childKeysMatchingQualifier: nil
andSortOrderings: nil];
keys = [self attachmentKeys];
if (aid < [keys count])
{
attachment = [self lookupAttachment: [keys objectAtIndex: aid]];
@@ -310,9 +309,7 @@
if (attTable)
{
*tablePtr = attTable;
*countPtr = [[self childKeysMatchingQualifier: nil
andSortOrderings: nil]
count];
*countPtr = [[attTable childKeys] count];
}
else
rc = MAPISTORE_ERR_NOT_FOUND;
@@ -661,8 +658,7 @@
inMemCtx: (TALLOC_CTX *) memCtx
{
*data = MAPIBoolValue (memCtx,
[[self childKeysMatchingQualifier: nil
andSortOrderings: nil] count] > 0);
[[self attachmentKeys] count] > 0);
return MAPISTORE_SUCCESS;
}
@@ -678,15 +674,27 @@
[self subclassResponsibility: _cmd];
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
- (NSArray *) attachmentKeys
{
if (!attachmentKeys)
{
attachmentKeys = [self attachmentKeysMatchingQualifier: nil
andSortOrderings: nil];
[attachmentKeys retain];
}
return attachmentKeys;
}
- (NSArray *) attachmentKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
if (qualifier)
[self errorWithFormat: @"qualifier is not used for attachments"];
if (sortOrderings)
[self errorWithFormat: @"sort orderings are not used for attachments"];
return attachmentKeys;
return [attachmentParts allKeys];
}
- (MAPIStoreAttachmentTable *) attachmentTable
+39
View File
@@ -20,6 +20,8 @@
* Boston, MA 02111-1307, USA.
*/
#import <Foundation/NSArray.h>
#import <NGExtensions/NSObject+Logs.h>
#import <SOGo/SOGoFolder.h>
@@ -39,6 +41,43 @@
[self logWithFormat: @"unimplemented method: %@", NSStringFromSelector (_cmd)];
}
- (NSArray *) childKeys
{
if (!childKeys)
{
childKeys = [(MAPIStoreFolder *)
container messageKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [(MAPIStoreFolder *)
container messageKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (id) lookupChild: (NSString *) childKey
{
return [(MAPIStoreFolder *) container lookupMessage: childKey];
-3
View File
@@ -126,9 +126,6 @@
- (NSDate *) creationTime;
- (NSDate *) lastModificationTime;
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;
@end
#endif /* MAPISTOREOBJECT_H */
-6
View File
@@ -440,10 +440,4 @@ static Class NSExceptionK, MAPIStoreFolderK;
return nil;
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{
return nil;
}
@end
+14 -35
View File
@@ -344,41 +344,6 @@ static Class NSDataK, NSStringK;
handleId = newHandleId;
}
- (NSArray *) childKeys
{
if (!childKeys)
{
childKeys = [container childKeysMatchingQualifier: nil
andSortOrderings: sortOrderings];
[childKeys retain];
}
return childKeys;
}
- (NSArray *) restrictedChildKeys
{
NSArray *keys;
if (!restrictedChildKeys)
{
if (restrictionState != MAPIRestrictionStateAlwaysTrue)
{
if (restrictionState == MAPIRestrictionStateNeedsEval)
keys = [container childKeysMatchingQualifier: restriction
andSortOrderings: sortOrderings];
else
keys = [NSArray array];
}
else
keys = [self childKeys];
ASSIGN (restrictedChildKeys, keys);
}
return restrictedChildKeys;
}
- (void) cleanupCaches
{
[restrictedChildKeys release];
@@ -818,6 +783,20 @@ static Class NSDataK, NSStringK;
return child;
}
- (NSArray *) childKeys
{
[self subclassResponsibility: _cmd];
return nil;
}
- (NSArray *) restrictedChildKeys
{
[self subclassResponsibility: _cmd];
return nil;
}
- (id) lookupChild: (NSString *) childKey
{
[self subclassResponsibility: _cmd];