121 // CRefineView::MatchL |
121 // CRefineView::MatchL |
122 // -------------------------------------------------------------------------- |
122 // -------------------------------------------------------------------------- |
123 // |
123 // |
124 void CRefineView::MatchL( RPointerArray<MVPbkSimContact>& aMatchedContacts ) |
124 void CRefineView::MatchL( RPointerArray<MVPbkSimContact>& aMatchedContacts ) |
125 { |
125 { |
|
126 CleanupClosePushL( aMatchedContacts ); |
126 const TInt contactCount = iParentView.ContactCountL(); |
127 const TInt contactCount = iParentView.ContactCountL(); |
127 for ( TInt i = 0; i < contactCount; ++i ) |
128 for ( TInt i = 0; i < contactCount; ++i ) |
128 { |
129 { |
129 // iParentView is always VPbkSimStore view and the contacts type |
130 // iParentView is always VPbkSimStore view and the contacts type |
130 // is CViewContact |
131 // is CViewContact |
138 MVPbkSimContact* nativeContact = |
139 MVPbkSimContact* nativeContact = |
139 const_cast<MVPbkSimContact*>( candidate.NativeContact() ); |
140 const_cast<MVPbkSimContact*>( candidate.NativeContact() ); |
140 aMatchedContacts.AppendL( nativeContact ); |
141 aMatchedContacts.AppendL( nativeContact ); |
141 } |
142 } |
142 } |
143 } |
|
144 CleanupStack::Pop(); |
143 } |
145 } |
144 |
146 |
145 // -------------------------------------------------------------------------- |
147 // -------------------------------------------------------------------------- |
146 // CRefineView::DoContactAddedToViewL |
148 // CRefineView::DoContactAddedToViewL |
147 // -------------------------------------------------------------------------- |
149 // -------------------------------------------------------------------------- |
148 // |
150 // |
149 void CRefineView::DoContactAddedToViewL( MVPbkContactViewBase& aView, |
151 void CRefineView::DoContactAddedToViewL( MVPbkContactViewBase& aView, |
150 TInt aIndex, const MVPbkContactLink& /*aContactLink*/, |
152 TInt aIndex, const MVPbkContactLink& /*aContactLink*/, |
151 RPointerArray<MVPbkSimContact>& aMatchedContacts ) |
153 RPointerArray<MVPbkSimContact>& aMatchedContacts ) |
152 { |
154 { |
|
155 CleanupClosePushL( aMatchedContacts ); |
153 if ( &iParentView == &aView && |
156 if ( &iParentView == &aView && |
154 IsMatchL( iParentView.ContactAtL( aIndex ))) |
157 IsMatchL( iParentView.ContactAtL( aIndex ))) |
155 { |
158 { |
156 // iParentView is always CFindView or CRefineView the contacts type |
159 // iParentView is always CFindView or CRefineView the contacts type |
157 // is CViewContact. It can be safely casted. |
160 // is CViewContact. It can be safely casted. |