Monotone-Parent: b0613f483a296b882038d9d023bcb71c82d4916e

Monotone-Revision: 0811b557e4a5f5fb3a026bfc3e9578e656e1d32b

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-07-26T19:02:45
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-07-26 19:02:45 +00:00
parent 21436999e5
commit 287625af3f
12 changed files with 58 additions and 38 deletions

View File

@ -1,3 +1,16 @@
2011-07-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreObject.m (-lookupChild:): removed method as
it was too generic. Each subclass has now its own set of
specialized methods.
* OpenChange/MAPIStoreMessage.m (-lookupAttachment:): new method,
replacing -[MAPIStoreObject lookupChild:].
* OpenChange/MAPIStoreFolder.m (-lookupFolder:, -lookupMessage:)
(-lookupFAIMessage:): new methods, replacing -[MAPIStoreObject
lookupChild:].
2011-07-26 Francis Lachapelle <flachapelle@inverse.ca>
* UI/MailerUI/UIxMailListActions.m

View File

@ -475,7 +475,7 @@
return attachmentKeys;
}
- (id) lookupChild: (NSString *) childKey
- (id) lookupAttachment: (NSString *) childKey
{
return [attachmentParts objectForKey: childKey];
}

View File

@ -167,7 +167,7 @@ e)
[self _saveAttachment: [attachmentKeys objectAtIndex: count]];
}
- (id) lookupChild: (NSString *) childKey
- (id) lookupAttachment: (NSString *) childKey
{
return [attachmentParts objectForKey: childKey];
}

View File

@ -153,9 +153,9 @@ static Class MAPIStoreFSMessageK;
return folderKeys;
}
- (id) lookupChild: (NSString *) childKey
- (id) lookupFolder: (NSString *) childKey
{
id childObject;
id childObject = nil;
SOGoMAPIFSFolder *childFolder;
[self folderKeys];
@ -166,8 +166,6 @@ static Class MAPIStoreFSMessageK;
childObject = [MAPIStoreFSFolder mapiStoreObjectWithSOGoObject: childFolder
inContainer: self];
}
else
childObject = [super lookupChild: childKey];
return childObject;
}
@ -191,7 +189,7 @@ static Class MAPIStoreFSMessageK;
max = [messageKeys count];
for (count = 0; count < max; count++)
{
msg = [self lookupChild: [messageKeys objectAtIndex: count]];
msg = [self lookupMessage: [messageKeys objectAtIndex: count]];
fileDate = [msg lastModificationTime];
if ([date laterDate: fileDate] == fileDate)
{

View File

@ -65,6 +65,7 @@
- (id) lookupFolder: (NSString *) folderKey;
- (id) lookupFolderByURL: (NSString *) folderURL;
- (id) lookupMessage: (NSString *) messageKey;
- (id) lookupFAIMessage: (NSString *) messageKey;
- (id) lookupMessageByURL: (NSString *) messageURL;
- (NSArray *) activeMessageTables;

View File

@ -190,6 +190,25 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
MAPIStoreObject *childMessage = nil;
SOGoObject *msgObject;
if (messageKey)
{
msgObject = [sogoObject lookupName: messageKey
inContext: nil
acquire: NO];
if (msgObject && ![msgObject isKindOfClass: NSExceptionK])
childMessage
= [[self messageClass] mapiStoreObjectWithSOGoObject: msgObject
inContainer: self];
}
return childMessage;
}
- (id) lookupFAIMessage: (NSString *) messageKey
{
MAPIStoreObject *childMessage = nil;
SOGoObject *msgObject;
if (messageKey)
{
[self faiMessageKeys];
@ -202,16 +221,6 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
= [MAPIStoreFAIMessageK mapiStoreObjectWithSOGoObject: msgObject
inContainer: self];
}
else
{
msgObject = [sogoObject lookupName: messageKey
inContext: nil
acquire: NO];
if (msgObject && ![msgObject isKindOfClass: NSExceptionK])
childMessage
= [[self messageClass] mapiStoreObjectWithSOGoObject: msgObject
inContainer: self];
}
}
return childMessage;
@ -220,7 +229,7 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
- (id) lookupMessageByURL: (NSString *) childURL
{
MAPIStoreObject *foundObject = nil;
NSString *baseURL, *subURL;
NSString *baseURL, *subURL, *key;
NSArray *parts;
NSUInteger partsCount;
@ -235,7 +244,12 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
parts = [subURL componentsSeparatedByString: @"/"];
partsCount = [parts count];
if (partsCount == 1)
foundObject = [self lookupMessage: [parts objectAtIndex: 0]];
{
key = [parts objectAtIndex: 0];
foundObject = [self lookupFAIMessage: key];
if (!foundObject)
foundObject = [self lookupMessage: key];
}
}
}
@ -659,11 +673,6 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
folderKeys = nil;
}
- (id) lookupChild: (NSString *) childKey
{
return [self lookupMessage: childKey];
}
- (int) getPrParentFid: (void **) data
inMemCtx: (TALLOC_CTX *) memCtx
{

View File

@ -250,9 +250,9 @@ static Class SOGoMailFolderK;
return [MAPIStoreMailFolderTable tableForContainer: self];
}
- (id) lookupChild: (NSString *) childKey
- (id) lookupFolder: (NSString *) childKey
{
id childObject;
id childObject = nil;
SOGoMailFolder *childFolder;
[self folderKeys];
@ -263,8 +263,6 @@ static Class SOGoMailFolderK;
childObject = [MAPIStoreMailFolder mapiStoreObjectWithSOGoObject: childFolder
inContainer: self];
}
else
childObject = [super lookupChild: childKey];
return childObject;
}

View File

@ -1151,7 +1151,7 @@ _compareBodyKeysByPriority (id entry1, id entry2, void *data)
andSortOrderings: sortOrderings];
}
- (id) lookupChild: (NSString *) childKey
- (id) lookupAttachment: (NSString *) childKey
{
MAPIStoreMailAttachment *attachment;
SOGoMailBodyPart *currentPart;

View File

@ -46,7 +46,9 @@
- (int) modifyRecipientsWithRows: (struct ModifyRecipientRow *) rows
andCount: (NSUInteger) max;
- (id) lookupAttachment: (NSString *) childKey;
/* backend methods */
- (int) createAttachment: (MAPIStoreAttachment **) attachmentPtr
inAID: (uint32_t *) aidPtr;
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPtr

View File

@ -271,6 +271,13 @@
return rc;
}
- (id) lookupAttachment: (NSString *) childKey
{
[self subclassResponsibility: _cmd];
return nil;
}
- (int) getAttachment: (MAPIStoreAttachment **) attachmentPtr
withAID: (uint32_t) aid
{
@ -282,7 +289,7 @@
andSortOrderings: nil];
if (aid < [keys count])
{
attachment = [self lookupChild: [keys objectAtIndex: aid]];
attachment = [self lookupAttachment: [keys objectAtIndex: aid]];
if (attachment)
{
*attachmentPtr = attachment;

View File

@ -126,7 +126,6 @@
- (NSDate *) creationTime;
- (NSDate *) lastModificationTime;
- (id) lookupChild: (NSString *) childKey;
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings;

View File

@ -440,13 +440,6 @@ static Class NSExceptionK, MAPIStoreFolderK;
return nil;
}
- (id) lookupChild: (NSString *) childKey
{
[self subclassResponsibility: _cmd];
return nil;
}
- (NSArray *) childKeysMatchingQualifier: (EOQualifier *) qualifier
andSortOrderings: (NSArray *) sortOrderings
{