engine/collectionframework/datasource/plugins/glxdatasourcemde2.5/src/glxdatasourcemds.cpp
changeset 48 d0b4e67b3a60
parent 36 6481344a6d67
child 71 27f2d7aec52a
equal deleted inserted replaced
36:6481344a6d67 48:d0b4e67b3a60
   548 															  iHarvestingOngoing);
   548 															  iHarvestingOngoing);
   549    	if (ENotifyAdd == aType)
   549    	if (ENotifyAdd == aType)
   550 		{
   550 		{
   551 	    for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
   551 	    for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
   552 	        {
   552 	        {
   553 			iAddedItems.Append(aObjectIdArray[i]);
   553             TInt ret = iAddedItems.Append(aObjectIdArray[i]);
       
   554             if (ret != KErrNone)
       
   555                 {
       
   556                 GLX_DEBUG2("ENotifyAdd-iAddedItems.Append() failed i(%d)", i);
       
   557                 }
   554 	        }
   558 	        }
   555 	    GLX_LOG_INFO1("ENotifyAdd - iAddedItems.Count()=%d", iAddedItems.Count());
   559 	    GLX_DEBUG2("ENotifyAdd - iAddedItems.Count()=%d", iAddedItems.Count());
   556 		}
   560 		}
   557     
   561     
   558    	if (ENotifyModify == aType)
   562    	if (ENotifyModify == aType)
   559 		{
   563 		{
   560 	    for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
   564 	    for ( TInt i = 0; i < aObjectIdArray.Count(); i++ )
   561 	        {
   565 	        {
   562 	        if (iAddedItems.Find(aObjectIdArray[i]) != KErrNotFound)
   566 	        if (iAddedItems.Find(aObjectIdArray[i]) != KErrNotFound)
   563 	        	{
   567 	        	{
   564 		        if (!iHarvestingOngoing)
   568 		        if (!iHarvestingOngoing)
   565 		        	{
   569 		        	{
   566 		        	GLX_LOG_INFO("ENotifyModify - Harvesting Completed - "
   570 		        	GLX_DEBUG1("ENotifyModify - Harvesting Completed - "
   567 		        	        "Reset iAddedItems array");
   571 		        	        "Reset iAddedItems array");
   568 					iAddedItems.Reset();
   572 					iAddedItems.Reset();
   569 					break;
   573 					break;
   570 		        	}
   574 		        	}
   571 		        GLX_LOG_INFO("ENotifyModify - Id found in iAddedItems array, DO NOT PROCESS");
   575                 GLX_DEBUG1("ENotifyModify - Id found in iAddedItems array, DO NOT PROCESS");
   572 	        	return;
   576 	        	return;
   573 	        	}
   577 	        	}
   574 	        }
   578 	        }
   575         }
   579         }
   576 
   580 
   577    	GLX_LOG_INFO("ProcessUpdateArray");
   581    	GLX_DEBUG1("HandleObjectNotification - ProcessUpdateArray");
   578 	ProcessUpdateArray(aObjectIdArray,  MPXChangeEventType(aType), ETrue);
   582 	ProcessUpdateArray(aObjectIdArray,  MPXChangeEventType(aType), ETrue);
   579 #ifndef USE_S60_TNM
   583 #ifndef USE_S60_TNM
   580 	if(MPXChangeEventType(aType) == EMPXItemDeleted )
   584 	if(MPXChangeEventType(aType) == EMPXItemDeleted )
   581 		{			
   585 		{			
   582 		TInt count = aObjectIdArray.Count();
   586 		TInt count = aObjectIdArray.Count();
   583 		iDeletedCount += count;
   587 		iDeletedCount += count;
   584 		GLX_LOG_INFO2("EMPXItemDeleted - aObjectIdArray.Count()=%d, iDeletedCount=%d", 
   588 		GLX_DEBUG3("EMPXItemDeleted - aObjectIdArray.Count()=%d, iDeletedCount=%d", 
   585 		        count, iDeletedCount);
   589 		        count, iDeletedCount);
   586 		if(iDeletedCount > KGlxThumbnailCleanupAfterDeletions)
   590 		if(iDeletedCount > KGlxThumbnailCleanupAfterDeletions)
   587 		    {
   591 		    {
   588 	    	TRAPD(err, ThumbnailCreator().CleanupThumbnailsL(iThumbnailDatabase));
   592 	    	TRAPD(err, ThumbnailCreator().CleanupThumbnailsL(iThumbnailDatabase));
   589 	    	if(!err)
   593 	    	if(!err)
   593 		    }
   597 		    }
   594 		}
   598 		}
   595 
   599 
   596 	if(MPXChangeEventType(aType) == EMPXItemModified )
   600 	if(MPXChangeEventType(aType) == EMPXItemModified )
   597 	    {
   601 	    {
   598 	    GLX_LOG_INFO("EMPXItemModified");
   602 	    GLX_DEBUG1("HandleObjectNotification - EMPXItemModified");
   599 	    TRAP_IGNORE(ThumbnailCreator().CleanupThumbnailsL(iThumbnailDatabase));
   603 	    TRAP_IGNORE(ThumbnailCreator().CleanupThumbnailsL(iThumbnailDatabase));
   600 		}
   604 		}
   601 #endif		
   605 #endif		
   602 	}
   606 	}
   603 
   607