Monotone-Parent: faa665d09f8735444e5cc6f1e0ca073851cbab3f

Monotone-Revision: d48fed214ae2d8c0aea1b8848de745e3ee235afa

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-11-07T15:07:37
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2011-11-07 15:07:37 +00:00
parent d02400dfc1
commit e67931703f
4 changed files with 32 additions and 33 deletions

View File

@ -1,3 +1,18 @@
2011-11-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreFolder.m (-addProperties:): we now override
this method instead of -addPropertiesFromRow:. Also, invoking
resetCache is no longer required since the "properties" ivar is
no longer used in this class.
* OpenChange/MAPIStoreObject.m (-addPropertiesFromRow:): now
invokes [self addProperties:] to modify the "properties" ivar,
instead of doing it directly. This enables subclasses to only need
overriding -addProperties:.
* OpenChange/MAPIStoreVolatileMessage.m (-addPropertiesFromRow:):
removed obsolete overloading of method.
2011-11-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/MAPIStoreMessage.m (-setReadFlag:): make overrides

View File

@ -898,33 +898,28 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe
return rc;
}
- (int) addPropertiesFromRow: (struct SRow *) aRow
- (void) addProperties: (NSDictionary *) newProperties
{
static enum MAPITAGS bannedProps[] = { PR_MID, PR_FID, PR_PARENT_FID,
PR_SOURCE_KEY, PR_PARENT_SOURCE_KEY,
PR_CHANGE_KEY, 0x00000000 };
enum MAPITAGS *currentProp;
int rc;
rc = [super addPropertiesFromRow: aRow];
NSMutableDictionary *propsCopy;
/* TODO: this should no longer be required once mapistore v2 API is in
place, when we can then do this from -dealloc below */
if ([properties count] > 0)
{
currentProp = bannedProps;
while (*currentProp)
{
[properties removeObjectForKey: MAPIPropertyKey (*currentProp)];
currentProp++;
}
[propsMessage appendProperties: properties];
[propsMessage save];
[self resetProperties];
propsCopy = [newProperties mutableCopy];
currentProp = bannedProps;
while (*currentProp)
{
[propsCopy removeObjectForKey: MAPIPropertyKey (*currentProp)];
currentProp++;
}
return rc;
[propsMessage appendProperties: propsCopy];
[propsMessage save];
[propsCopy release];
}
- (void) dealloc

View File

@ -451,14 +451,18 @@ static Class NSExceptionK, MAPIStoreFolderK;
{
struct SPropValue *cValue;
NSUInteger counter;
NSMutableDictionary *newProperties;
newProperties = [NSMutableDictionary dictionaryWithCapacity: aRow->cValues];
for (counter = 0; counter < aRow->cValues; counter++)
{
cValue = aRow->lpProps + counter;
[properties setObject: NSObjectFromSPropValue (cValue)
forKey: MAPIPropertyKey (cValue->ulPropTag)];
[newProperties setObject: NSObjectFromSPropValue (cValue)
forKey: MAPIPropertyKey (cValue->ulPropTag)];
}
[self addProperties: newProperties];
return MAPISTORE_SUCCESS;
}

View File

@ -80,21 +80,6 @@ Class NSNumberK;
[super dealloc];
}
- (int) addPropertiesFromRow: (struct SRow *) aRow
{
int rc;
rc = [super addPropertiesFromRow: aRow];
if (rc == MAPISTORE_SUCCESS)
{
[sogoObject appendProperties: properties];
[properties removeAllObjects];
ASSIGN (lastModificationTime, [NSDate date]);
}
return rc;
}
- (void) addProperties: (NSDictionary *) newProperties
{
[super addProperties: newProperties];