phonebookengines/VirtualPhonebook/VPbkSimStore/src/CRefineView.cpp
branchRCL_3
changeset 32 2828b4d142c0
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
equal deleted inserted replaced
26:0d28c1c5b6dd 32:2828b4d142c0
   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.
   196             }
   199             }
   197         else
   200         else
   198             {
   201             {
   199             aMatchedContacts.AppendL( nativeContact );
   202             aMatchedContacts.AppendL( nativeContact );
   200             }
   203             }
   201         }    
   204         }   
       
   205     CleanupStack::Pop();
   202     }
   206     }
   203 
   207 
   204 // --------------------------------------------------------------------------
   208 // --------------------------------------------------------------------------
   205 // CRefineView::UpdateFilterL
   209 // CRefineView::UpdateFilterL
   206 // --------------------------------------------------------------------------
   210 // --------------------------------------------------------------------------