--- a/harvester/common/src/harvesterplugin.cpp Fri Aug 06 09:56:02 2010 +0300
+++ b/harvester/common/src/harvesterplugin.cpp Mon Aug 23 13:33:21 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();