17 |
17 |
18 |
18 |
19 #include "CVPbkImportToContactsMergeOperation.h" |
19 #include "CVPbkImportToContactsMergeOperation.h" |
20 #include "VPbkVCardEngError.h" |
20 #include "VPbkVCardEngError.h" |
21 #include "CVPbkVCardImporter.h" |
21 #include "CVPbkVCardImporter.h" |
|
22 #include "CVPbkDefaultAttribute.h" |
|
23 #include "CVPbkLocalVariationManager.h" |
22 |
24 |
23 // Virtual Phonebook |
25 // Virtual Phonebook |
24 #include <MVPbkStoreContact.h> |
26 #include <MVPbkStoreContact.h> |
25 #include <MVPbkContactStore.h> |
27 #include <MVPbkContactStore.h> |
26 #include <MVPbkContactLink.h> |
28 #include <MVPbkContactLink.h> |
29 #include <MVPbkFieldType.h> |
31 #include <MVPbkFieldType.h> |
30 #include <MVPbkContactFieldData.h> |
32 #include <MVPbkContactFieldData.h> |
31 #include <MVPbkContactFieldUriData.h> |
33 #include <MVPbkContactFieldUriData.h> |
32 #include <MVPbkContactFieldTextData.h> |
34 #include <MVPbkContactFieldTextData.h> |
33 #include <MVPbkSingleContactOperationObserver.h> |
35 #include <MVPbkSingleContactOperationObserver.h> |
34 #include "CVPbkDefaultAttribute.h" |
|
35 const TInt KGranularity = 4; |
36 const TInt KGranularity = 4; |
36 |
37 |
37 namespace{ |
38 namespace{ |
38 #ifdef _DEBUG |
39 #ifdef _DEBUG |
39 |
40 |
221 ReRetrieveContactL(); |
222 ReRetrieveContactL(); |
222 break; |
223 break; |
223 } |
224 } |
224 case EComplete: |
225 case EComplete: |
225 { |
226 { |
226 if(iGroupcardHandler && ((CVPbkVCardImporter *)iOperationImpl)->IsGroupcard()) |
227 TBool isGroupCard = ((CVPbkVCardImporter *)iOperationImpl)->IsGroupcard(); |
|
228 if(iGroupcardHandler && isGroupCard) |
227 { |
229 { |
228 iGroupcardHandler->BuildContactGroupsHashMapL(iContact->ParentStore()); |
230 iGroupcardHandler->BuildContactGroupsHashMapL(iContact->ParentStore()); |
229 const MVPbkContactLink* contact = iContact->CreateLinkLC(); |
231 const MVPbkContactLink* contact = iContact->CreateLinkLC(); |
230 iGroupcardHandler->GetContactGroupStoreL(*contact); |
232 iGroupcardHandler->GetContactGroupStoreL(*contact); |
231 CleanupStack::PopAndDestroy(); // For contact |
233 CleanupStack::PopAndDestroy(); // For contact |
232 iGroupcardHandler->DecodeContactGroupInVCardL(((CVPbkVCardImporter *)iOperationImpl)->GetGroupcardvalue()); |
234 iGroupcardHandler->DecodeContactGroupInVCardL(((CVPbkVCardImporter *)iOperationImpl)->GetGroupcardvalue()); |
233 } |
235 } |
|
236 |
|
237 CVPbkLocalVariationManager* lvm = CVPbkLocalVariationManager::NewL(); |
|
238 TBool supportSyncGroupVcard = lvm->LocallyVariatedFeatureEnabled( EVPbkLVSyncGroupEnabled ); |
|
239 delete lvm; |
|
240 if (supportSyncGroupVcard && iGroupcardHandler && !isGroupCard) |
|
241 { |
|
242 iGroupcardHandler->BuildContactGroupsHashMapL(iContact->ParentStore()); |
|
243 const MVPbkContactLink *aContact = iContact->CreateLinkLC(); |
|
244 iGroupcardHandler->GetContactGroupStoreL(*aContact); |
|
245 CleanupStack::PopAndDestroy(); |
|
246 iGroupcardHandler->DeleteContactFromGroupsL(); |
|
247 } |
|
248 |
234 iObserver.VPbkSingleContactOperationComplete( *this, iContact ); |
249 iObserver.VPbkSingleContactOperationComplete( *this, iContact ); |
235 iContact = NULL; |
250 iContact = NULL; |
236 break; |
251 break; |
237 } |
252 } |
238 default: |
253 default: |