diff -r 6b5524b4f673 -r 38bb213f60ba phonebookui/Phonebook2/UIControls/src/CPbk2FetchResults.cpp --- a/phonebookui/Phonebook2/UIControls/src/CPbk2FetchResults.cpp Wed Sep 15 11:56:55 2010 +0300 +++ b/phonebookui/Phonebook2/UIControls/src/CPbk2FetchResults.cpp Wed Oct 13 14:15:33 2010 +0300 @@ -38,7 +38,6 @@ // System includes #include -#include // Debugging headers #include @@ -57,9 +56,7 @@ iFetchDlg( aFetchDlg ), iPages( aPages ), iObserver( aObserver ), - iResultsObserver( aResultsObserver ), - iWaitingForDelayedAppend( EFalse ), - iInputBlock( NULL ) + iResultsObserver( aResultsObserver ) { } @@ -89,8 +86,6 @@ delete iOperationQueue; } - - delete iWaitForAllOperationComplete; } // -------------------------------------------------------------------------- @@ -112,8 +107,6 @@ } iOperationQueue = new (ELeave) CArrayFixFlat(4); - - iWaitForAllOperationComplete = new (ELeave) CActiveSchedulerWait(); } // -------------------------------------------------------------------------- @@ -140,17 +133,10 @@ // -------------------------------------------------------------------------- // void CPbk2FetchResults::AppendL( const MVPbkContactLink& aLink ) - { - if ( iFetchDlg.IsSelectPermitted() ) - { - CFRConatactOperation* newAppendOperation = CFRConatactOperation::NewL( aLink, CFRConatactOperation::EAppendContact ); - AppendContactOperationL(newAppendOperation); - ProcessNextContactOperationL(); - } - else - { - iPages.SelectContactL( aLink, EFalse ); - } + { + CFRConatactOperation* newAppendOperation = CFRConatactOperation::NewL( aLink, CFRConatactOperation::EAppendContact ); + AppendContactOperationL(newAppendOperation); + ProcessNextContactOperationL(); } // -------------------------------------------------------------------------- @@ -159,24 +145,8 @@ // void CPbk2FetchResults::AppendDelayedL( const MVPbkContactLink& aLink ) { - // Add the feedback contact's operation to the head of the queue - // in order to ensure that the checked contact's operation to be - // handled firstly when phonebook receives the client feedback. CFRConatactOperation* newAppendOperation = CFRConatactOperation::NewL( aLink, CFRConatactOperation::EAppendContactDelayed ); - iOperationQueue->InsertL( 0, newAppendOperation ); - // Waiting is over. - iWaitingForDelayedAppend = EFalse; - ProcessNextContactOperationL(); - } - -// -------------------------------------------------------------------------- -// CPbk2FetchResults::DenyAppendDelayedL -// -------------------------------------------------------------------------- -// -void CPbk2FetchResults::DenyAppendDelayedL( const MVPbkContactLink& aLink ) - { - // Waiting is over, process next contact operation - iWaitingForDelayedAppend = EFalse; + AppendContactOperationL(newAppendOperation); ProcessNextContactOperationL(); } @@ -206,21 +176,6 @@ } // -------------------------------------------------------------------------- -// CPbk2FetchResults::WaitOperationsCompleteL -// -------------------------------------------------------------------------- -// -void CPbk2FetchResults::WaitOperationsCompleteL() - { - if ( iWaitingForDelayedAppend || iOperationQueue->Count()>0 ) - { - iInputBlock = CAknInputBlock::NewLC(); - CleanupStack::Pop( iInputBlock ); - - iWaitForAllOperationComplete->Start(); - } - } - -// -------------------------------------------------------------------------- // CPbk2FetchResults::Count // -------------------------------------------------------------------------- // @@ -373,13 +328,6 @@ { // Observer needs to asked accept = iObserver.AcceptFetchSelectionL( count, *link ); - // Determine whether accept query is needed - if ( MPbk2FetchDlgObserver::EFetchDelayed == accept ) - { - // Start to wait client feedback, block the operation queue, - // process next operation until receive client feedback. - iWaitingForDelayedAppend = ETrue; - } } if ( accept == MPbk2FetchDlgObserver::EFetchNo ) @@ -541,6 +489,8 @@ // Remove executed operation from queue RemoveCurrentContactOperation(); + // Initialize next operation from queue + ProcessNextContactOperationL(); /**********************************************************************/ /**************! Dont use class members after SWITCH !*****************/ @@ -555,26 +505,17 @@ case CFRConatactOperation::EAppendContact: { DoAppendContactL( *aContact, EFalse ); - // Check whether next operation can be processed - // after sending check request to client. - ProcessNextContactOperationL(); break; } case CFRConatactOperation::EAppendContactDelayed: { - // Process new contact opretation before appending - // the delayed contact to results. It can save time. - ProcessNextContactOperationL(); DoAppendContactL( *aContact, ETrue ); break; } case CFRConatactOperation::ERemoveContact: { - // Process new contact opretation before removing contact - // from results. It can save time. - ProcessNextContactOperationL(); DoRemoveContactL( *aContact ); break; } @@ -589,7 +530,7 @@ // void CPbk2FetchResults::ProcessNextContactOperationL() { - if( !iRetrieveOperation && !iWaitingForDelayedAppend ) + if( !iRetrieveOperation ) { // No operation is executing -> process next one @@ -597,23 +538,13 @@ { // Start asynchronous contact retrieve operation, which completes // in CPbk2FetchResults::HandleContactOperationCompleteL. - iRetrieveOperation = iContactManager.RetrieveContactL( - *( GetCurrentContactOperation()->GetContactLink() ), - *this ); + iRetrieveOperation = iContactManager.RetrieveContactL( *( GetCurrentContactOperation()->GetContactLink() ), + *this ); } else { - if ( !iWaitingForDelayedAppend ) - { - // Every seleced contacts' operation finishes, - // stop the scheduler waiting for every operation. - if (iWaitForAllOperationComplete->IsStarted()) - iWaitForAllOperationComplete->AsyncStop(); - - // Stop blocking input - delete iInputBlock; - iInputBlock = NULL; - } + // Empty operation queue -> do nothing + PBK2_DEBUG_PRINT(PBK2_DEBUG_STRING( "CPbk2FetchResults::ProcessNextContactOperationL emtpy queue" )); } } else