diff -r a93990e5815e -r 40db28bb26b8 harvester/common/src/harvesterplugin.cpp --- a/harvester/common/src/harvesterplugin.cpp Wed Aug 18 10:12:07 2010 +0300 +++ b/harvester/common/src/harvesterplugin.cpp Thu Sep 02 20:52:02 2010 +0300 @@ -65,7 +65,8 @@ iDtor_ID_Key( KNullUid ), iOriginPropertyDef( NULL ), iTitlePropertyDef( NULL ), - iHarvesting( EFalse ) + iHarvesting( EFalse ), + iPaused( EFalse ) { } @@ -109,6 +110,7 @@ { if( iState == EHarvesterIdle ) { + iPaused = EFalse; SetNextRequest( EHarvesterGathering ); } } @@ -154,6 +156,7 @@ } else { + WRITELOG( "CHarvesterPlugin::RunL EHarvesterGathering - items in queue" ); if ( !iHarvesting ) { TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( ETrue ) ); @@ -244,12 +247,28 @@ } // --------------------------------------------------------------------------- +// StartHarvest +// --------------------------------------------------------------------------- +// +EXPORT_C void CHarvesterPlugin::StopHarvest() + { + Cancel(); + iState = EHarvesterIdle; + if( iHarvesting ) + { + TRAP_IGNORE( iFactory->SendHarvestingStatusEventL( EFalse ) ); + iHarvesting = EFalse; + } + iPaused = ETrue; + } + +// --------------------------------------------------------------------------- // SetNextRequest // --------------------------------------------------------------------------- // void CHarvesterPlugin::SetNextRequest( THarvesterState aState ) { - if ( ! IsActive() ) + if ( !IsActive() && !iPaused ) { iState = aState; SetActive();