From 9e551cca5bc0aebda0dcc0cc09f4de398bd793c7 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 12 Oct 2012 23:27:05 -0400 Subject: [PATCH] registerURLs:withIDs: now takes an array of NSNumber or NSString instances --- OpenChange/MAPIStoreMapping.h | 2 +- OpenChange/MAPIStoreMapping.m | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/OpenChange/MAPIStoreMapping.h b/OpenChange/MAPIStoreMapping.h index 0b1aa3f53..c974c7496 100644 --- a/OpenChange/MAPIStoreMapping.h +++ b/OpenChange/MAPIStoreMapping.h @@ -54,7 +54,7 @@ - (BOOL) registerURL: (NSString *) urlString withID: (uint64_t) idNbr; - (void) registerURLs: (NSArray *) urlString - withIDs: (struct UI8Array_r *) idNbrs; + withIDs: (NSArray *) idNbrs; - (void) unregisterURLWithID: (uint64_t) idNbr; - (void) updateID: (uint64_t) idNbr withURL: (NSString *) urlString; diff --git a/OpenChange/MAPIStoreMapping.m b/OpenChange/MAPIStoreMapping.m index 770721b23..ffc035aea 100644 --- a/OpenChange/MAPIStoreMapping.m +++ b/OpenChange/MAPIStoreMapping.m @@ -334,17 +334,21 @@ MAPIStoreMappingTDBTraverse (TDB_CONTEXT *ctx, TDB_DATA data1, TDB_DATA data2, } - (void) registerURLs: (NSArray *) urlStrings - withIDs: (struct UI8Array_r *) idNbrs + withIDs: (NSArray *) idNbrs { - uint64_t count, max; + uint64_t count, max, newID; max = [urlStrings count]; - if (max == idNbrs->cValues) + if (max == [idNbrs count]) { tdb_transaction_start (indexing->tdb); for (count = 0; count < max; count++) - [self registerURL: [urlStrings objectAtIndex: count] - withID: idNbrs->lpui8[count]]; + { + newID = [[idNbrs objectAtIndex: count] + unsignedLongLongValue]; + [self registerURL: [urlStrings objectAtIndex: count] + withID: newID]; + } tdb_transaction_commit (indexing->tdb); } else