phonebookengines/VirtualPhonebook/VPbkCntModel/src/CFindViewBase.cpp
branchRCL_3
changeset 8 5586b4d2ec3e
parent 0 e686773b3f54
equal deleted inserted replaced
7:b3431bff8c19 8:5586b4d2ec3e
    85         MParentViewForFiltering& aParentView,
    85         MParentViewForFiltering& aParentView,
    86         CViewBase& aBaseView,
    86         CViewBase& aBaseView,
    87         TBool aOwnsContacts ) :
    87         TBool aOwnsContacts ) :
    88             iParentView( aParentView ),
    88             iParentView( aParentView ),
    89             iBaseView( aBaseView ),
    89             iBaseView( aBaseView ),
    90             iOwnsContacts( aOwnsContacts )
    90             iOwnsContacts( aOwnsContacts ),
       
    91             iDestroyed( NULL )
    91     {
    92     {
    92     }
    93     }
    93 
    94 
    94 // --------------------------------------------------------------------------
    95 // --------------------------------------------------------------------------
    95 // CFindViewBase::BaseConstructL
    96 // CFindViewBase::BaseConstructL
   134     iFilteringObservers.Close();
   135     iFilteringObservers.Close();
   135 
   136 
   136     delete iViewContact;
   137     delete iViewContact;
   137     delete iFieldTypeRefsList;
   138     delete iFieldTypeRefsList;
   138     delete iFindStrings;
   139     delete iFindStrings;
       
   140     if ( iDestroyed )
       
   141         {
       
   142         *iDestroyed = ETrue;
       
   143         }
   139     }
   144     }
   140 
   145 
   141 // --------------------------------------------------------------------------
   146 // --------------------------------------------------------------------------
   142 // CFindViewBase::ActivateContactMatchL
   147 // CFindViewBase::ActivateContactMatchL
   143 // --------------------------------------------------------------------------
   148 // --------------------------------------------------------------------------
   498     {
   503     {
   499     TRAPD( error, DoContactViewReadyForFilteringL( aView ) );
   504     TRAPD( error, DoContactViewReadyForFilteringL( aView ) );
   500     if ( error != KErrNone )
   505     if ( error != KErrNone )
   501         {
   506         {
   502         ContactViewError( aView, error, EFalse );
   507         ContactViewError( aView, error, EFalse );
       
   508         }
       
   509     else
       
   510         {
       
   511         ContactViewReady( aView );
   503         }
   512         }
   504     }
   513     }
   505 
   514 
   506 // --------------------------------------------------------------------------
   515 // --------------------------------------------------------------------------
   507 // CFindViewBase::ContactViewUnavailableForFiltering
   516 // CFindViewBase::ContactViewUnavailableForFiltering
   784 // --------------------------------------------------------------------------
   793 // --------------------------------------------------------------------------
   785 //
   794 //
   786 void CFindViewBase::SendContactViewErrorEvent( TInt aError,
   795 void CFindViewBase::SendContactViewErrorEvent( TInt aError,
   787         TBool aErrorNotified )
   796         TBool aErrorNotified )
   788     {
   797     {
       
   798     TBool destroy = EFalse;
       
   799     iDestroyed = &destroy;
       
   800 
   789     // Send first to external observers...
   801     // Send first to external observers...
   790     VPbkEng::SendEventToObservers( *this, aError, aErrorNotified, iObservers,
   802     VPbkEng::SendEventToObserversWhenNotDestroyed( *this, aError, aErrorNotified, iObservers,
   791         &MVPbkContactViewObserver::ContactViewError );
   803         &MVPbkContactViewObserver::ContactViewError, destroy );
   792     // ...then to internal. This ensures that events come first from lower
   804     // ...then to internal. This ensures that events come first from lower
   793     // level find view.
   805     // level find view.
   794     VPbkEng::SendEventToObservers( *this, aError, aErrorNotified,
   806     VPbkEng::SendEventToObserversWhenNotDestroyed( *this, aError, aErrorNotified,
   795         iFilteringObservers, &MVPbkContactViewObserver::ContactViewError );
   807         iFilteringObservers, &MVPbkContactViewObserver::ContactViewError, destroy );
       
   808     
       
   809     if ( !destroy )
       
   810         {
       
   811         iDestroyed = NULL;
       
   812         }
   796     }
   813     }
   797 } // namespace VPbkCntModel
   814 } // namespace VPbkCntModel
   798 // End of File
   815 // End of File