52 |
53 |
53 MVPbkContactOperation* CVPbkPhoneNumberParallelMatchStrategy::CreateFindOperationLC( |
54 MVPbkContactOperation* CVPbkPhoneNumberParallelMatchStrategy::CreateFindOperationLC( |
54 const TDesC& aPhoneNumber) |
55 const TDesC& aPhoneNumber) |
55 { |
56 { |
56 CVPbkContactFindOperation* operation = NULL; |
57 CVPbkContactFindOperation* operation = NULL; |
57 |
58 |
58 if (!iMatchingStarted) |
59 if (!iMatchingStarted) |
59 { |
60 { |
60 operation = CVPbkContactFindOperation::NewLC(FindObserver()); |
61 operation = CVPbkContactFindOperation::NewLC(FindObserver()); |
61 const TInt storeCount = StoresToMatch().Count(); |
62 const TInt storeCount = StoresToMatch().Count(); |
|
63 TInt maxDigits = MaxMatchDigits(); |
|
64 |
62 for (TInt i = 0; i < storeCount; ++i) |
65 for (TInt i = 0; i < storeCount; ++i) |
63 { |
66 { |
64 MVPbkContactOperation* subOperation = |
67 MVPbkContactOperation* subOperation = NULL; |
65 StoresToMatch()[i]->CreateMatchPhoneNumberOperationL( |
68 |
66 aPhoneNumber, MaxMatchDigits(), *operation); |
69 if ( maxDigits == KBestMatchingPhoneNumbers && |
|
70 IsSimStore( *( StoresToMatch()[i] ) ) ) |
|
71 { |
|
72 // KBestMatchingPhoneNumbers enables best matching strategy |
|
73 // on store level only for phone memory stores, for sim store |
|
74 // MaxDigits parameter should be set to 7 or greater |
|
75 const TInt KMaxDigitsForSimStore = 7; |
|
76 subOperation = StoresToMatch()[i]->CreateMatchPhoneNumberOperationL( |
|
77 aPhoneNumber, KMaxDigitsForSimStore, *operation); |
|
78 } |
|
79 else |
|
80 { |
|
81 subOperation = StoresToMatch()[i]->CreateMatchPhoneNumberOperationL( |
|
82 aPhoneNumber, maxDigits, *operation); |
|
83 } |
|
84 |
67 if (subOperation) |
85 if (subOperation) |
68 { |
86 { |
69 CleanupDeletePushL(subOperation); |
87 CleanupDeletePushL(subOperation); |
70 operation->AddSubOperationL(subOperation); |
88 operation->AddSubOperationL(subOperation); |
71 CleanupStack::Pop(); // subOperation |
89 CleanupStack::Pop(); // subOperation |