harvester/common/src/harvesterpluginfactory.cpp
changeset 36 aa5a574040a4
parent 23 33ae025ac1e8
child 40 910a23996aa0
child 45 a93990e5815e
child 54 a3cc46f37772
--- a/harvester/common/src/harvesterpluginfactory.cpp	Wed Jun 23 18:41:19 2010 +0300
+++ b/harvester/common/src/harvesterpluginfactory.cpp	Tue Jul 06 14:44:37 2010 +0300
@@ -439,13 +439,22 @@
     {
     const TInt pluginInfoCount = iHarvesterPluginInfoArray.Count();
     TBool itemsLeft( EFalse );
+    TBool allPluginsOnIdle( ETrue );
     for ( TInt i = pluginInfoCount; --i >= 0; )
         {
         CHarvesterPluginInfo* info = iHarvesterPluginInfoArray[i];
         if( info && info->iQueue.Count() )
             {
             itemsLeft = ETrue;
-            break;
+            if( aStarted )
+                {
+                // Idle state is only checked if finished event is sent
+                break;
+                }
+            }
+        if( info && info->iPlugin && !(info->iPlugin->PluginInIdleState()) )
+            {
+            allPluginsOnIdle = EFalse;
             }
         }
     
@@ -458,7 +467,7 @@
         iHarvesterEventManager->IncreaseItemCount( EHEObserverTypeOverall, KCacheItemCountForEventCaching );
         return;
         }
-    else if( iHarvesting && !itemsLeft && !aStarted )
+    else if( iHarvesting && (!itemsLeft || allPluginsOnIdle) && !aStarted )
         {
         iHarvesting = EFalse;                       
         iHarvesterEventManager->SendEventL( EHEObserverTypeOverall, EHEStateFinished );