imagehandlingutilities/thumbnailmanager/thumbagdaemon/src/thumbagprocessor.cpp
branchRCL_3
changeset 11 dea39715fc05
parent 10 7403edfcf0fb
child 13 ee674526fac5
equal deleted inserted replaced
10:7403edfcf0fb 11:dea39715fc05
    93     iActivityManager = CTMActivityManager::NewL( this, KBackgroundGenerationIdle);
    93     iActivityManager = CTMActivityManager::NewL( this, KBackgroundGenerationIdle);
    94 
    94 
    95     UpdatePSValues(ETrue);
    95     UpdatePSValues(ETrue);
    96 
    96 
    97     if(iForegroundGenerationObserver)
    97     if(iForegroundGenerationObserver)
    98       {
    98         {
    99       delete iForegroundGenerationObserver;
    99         delete iForegroundGenerationObserver;
   100       iForegroundGenerationObserver = NULL;
   100         iForegroundGenerationObserver = NULL;
   101       }
   101         }
   102     
   102     
   103     RProperty::Define(KTAGDPSNotification, KMPXHarvesting, RProperty::EInt);
   103     RProperty::Define(KTAGDPSNotification, KMPXHarvesting, RProperty::EInt);
   104     
   104     
   105 	//start foreground generation observer
   105 	//start foreground generation observer
   106     iForegroundGenerationObserver = CTMRPropertyObserver::NewL( *this, KTAGDPSNotification, KForceBackgroundGeneration, ETrue );  
   106     iForegroundGenerationObserver = CTMRPropertyObserver::NewL( *this, KTAGDPSNotification, KForceBackgroundGeneration, ETrue );  
   501                     {
   501                     {
   502                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - remove from placeholder queue");
   502                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - remove from placeholder queue");
   503                     iPlaceholderQueue.Remove( itemIndex );
   503                     iPlaceholderQueue.Remove( itemIndex );
   504                     }
   504                     }
   505                 
   505                 
   506                 if(iAddQueue.Find( aIDArray[i]) == KErrNotFound && i2ndRoundGenerateQueue.Find( aIDArray[i]))
   506                 if(iAddQueue.Find( aIDArray[i]) == KErrNotFound && i2ndRoundGenerateQueue.Find( aIDArray[i]) == KErrNotFound )
   507                     {
   507                     {
   508                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append to add queue");
   508                     TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append to add queue");
   509                     iAddQueue.Append( aIDArray[i]);
   509                     iAddQueue.Append( aIDArray[i]);
   510                     }
   510                     }
   511                 }
   511                 }
   986             TInt serveIdle(KErrNotFound);
   986             TInt serveIdle(KErrNotFound);
   987             TInt ret = RProperty::Get(KServerIdle, KIdle, serveIdle);
   987             TInt ret = RProperty::Get(KServerIdle, KIdle, serveIdle);
   988             
   988             
   989             if(ret != KErrNone || !serveIdle )
   989             if(ret != KErrNone || !serveIdle )
   990                 {
   990                 {
   991                     //start inactivity timer and retry on after callback
   991             	//start inactivity timer and retry on after callback
   992                     TN_DEBUG1( "void CThumbAGProcessor::RunL() server not idle");
   992             	TN_DEBUG1( "void CThumbAGProcessor::RunL() server not idle");
   993                     StartTimeout();
   993                 StartTimeout();
   994                     return;
   994                 return;
   995                 }
   995                 }
   996             TN_DEBUG1( "void CThumbAGProcessor::RunL() device and server idle, process");
   996             TN_DEBUG1( "void CThumbAGProcessor::RunL() device and server idle, process");
   997             }
   997             }
   998 	    }
   998 	    }
   999     
   999     
  1495 			 
  1495 			 
  1496             if( iModifyQueue.Count() == 0)
  1496             if( iModifyQueue.Count() == 0)
  1497 			    {
  1497 			    {
  1498 			    SetForceRun( EFalse );
  1498 			    SetForceRun( EFalse );
  1499 		        }
  1499 		        }
  1500 			 
  1500             }
  1501             continue;
  1501             
  1502             }
  1502         itemIndex = iQueryQueue.Find( aIDArray[i] );
  1503     
  1503                      
  1504         /*if( aRemoveFromDelete )
  1504         if(itemIndex >= 0)
       
  1505             {
       
  1506             iQueryQueue.Remove(itemIndex);
       
  1507             TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iQueryQueue" );
       
  1508             }
       
  1509         
       
  1510         itemIndex = iPlaceholderQueue.Find( aIDArray[i] );
       
  1511                       
       
  1512         if(itemIndex >= 0)
       
  1513         	{
       
  1514             iPlaceholderQueue.Remove(itemIndex);
       
  1515             TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iPlaceholderQueue" );
       
  1516             }
       
  1517         
       
  1518         /*
       
  1519         if( aRemoveFromDelete )
  1505             {
  1520             {
  1506             itemIndex = iRemoveQueue.Find( aIDArray[i] );
  1521             itemIndex = iRemoveQueue.Find( aIDArray[i] );
  1507              
  1522              
  1508             if(itemIndex >= 0)
  1523             if(itemIndex >= 0)
  1509                 {
  1524                 {
  1753     if(itemsLeft + i2ndRoundGenerateQueue.Count() + iRemoveQueue.Count() > 0 )
  1768     if(itemsLeft + i2ndRoundGenerateQueue.Count() + iRemoveQueue.Count() > 0 )
  1754         {
  1769         {
  1755         daemonProcessing = ETrue;
  1770         daemonProcessing = ETrue;
  1756         }
  1771         }
  1757     
  1772     
       
  1773     //disable 2nd round generarion when there is items in 1st round queues
       
  1774     //or 2nd queue is empty 
       
  1775     if( !i2ndRoundGenerateQueue.Count() || itemsLeft )
       
  1776         {
       
  1777         i2ndRound = EFalse;
       
  1778         }
       
  1779     
       
  1780     //adjust items left to containing also items not yet processed but removed from queue under processing
       
  1781     if((iLastQueue == &iModifyQueue || iLastQueue == &iAddQueue) && !i2ndRound)
       
  1782         {
       
  1783         itemsLeft +=iQueryQueue.Count();
       
  1784         }
       
  1785     
       
  1786     TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() KItemsleft == %d", itemsLeft);
       
  1787     
  1758     if(aDefine)
  1788     if(aDefine)
  1759         {
  1789         {
  1760         TN_DEBUG1( "CThumbAGProcessor::UpdatePSValues() define");
  1790         TN_DEBUG1( "CThumbAGProcessor::UpdatePSValues() define");
  1761         RProperty::Define(KTAGDPSNotification, KDaemonProcessing, RProperty::EInt);
  1791         RProperty::Define(KTAGDPSNotification, KDaemonProcessing, RProperty::EInt);
  1762         RProperty::Set(KTAGDPSNotification, KDaemonProcessing, 0);
  1792         RProperty::Set(KTAGDPSNotification, KDaemonProcessing, 0);