photosgallery/viewframework/views/listview/src/glxpreviewthumbnailbinding.cpp
branchRCL_3
changeset 35 420f6808bf21
parent 18 bcb43dc84c44
equal deleted inserted replaced
32:78ad99c24f08 35:420f6808bf21
    19 #include <mglxmedialist.h>
    19 #include <mglxmedialist.h>
    20 #include <glxthumbnailcontext.h>
    20 #include <glxthumbnailcontext.h>
    21 #include <glxfilterfactory.h>                         // For TGlxFilterFactory
    21 #include <glxfilterfactory.h>                         // For TGlxFilterFactory
    22 #include <glxthumbnailattributeinfo.h>
    22 #include <glxthumbnailattributeinfo.h>
    23 #include <glxuiutility.h>                               // For UiUtility instance
    23 #include <glxuiutility.h>                               // For UiUtility instance
    24 #include <glxcollectionpluginmonths.hrh>
       
    25 #include <glxtracer.h>
    24 #include <glxtracer.h>
    26 #include <glxlog.h>
    25 #include <glxlog.h>
    27 #include <glxerrormanager.h>             // For CGlxErrormanager
    26 #include <glxerrormanager.h>             // For CGlxErrormanager
    28 #include <glxuistd.h>                    // Fetch context priority def'ns
    27 #include <glxuistd.h>                    // Fetch context priority def'ns
    29 #include <mglxcache.h> 
    28 #include <mglxcache.h> 
   207 // This function basically closes the old medialist if any for ex. Tags, 
   206 // This function basically closes the old medialist if any for ex. Tags, 
   208 // Captured.. and then opens a new medialist with teh required filter.
   207 // Captured.. and then opens a new medialist with teh required filter.
   209 // ----------------------------------------------------------------------------
   208 // ----------------------------------------------------------------------------
   210 //    
   209 //    
   211 void CGlxPreviewThumbnailBinding::HandleItemChangedL(const CMPXCollectionPath& aPath,
   210 void CGlxPreviewThumbnailBinding::HandleItemChangedL(const CMPXCollectionPath& aPath,
   212         TBool aPopulateListTNs, TBool  aIsRefreshNeeded, TBool aBackwardNavigation)
   211         TBool  aIsRefreshNeeded, TBool aBackwardNavigation)
   213     {
   212     {
   214     TRACER("CGlxPreviewThumbnailBinding::HandleItemChangedL");
   213     TRACER("CGlxPreviewThumbnailBinding::HandleItemChangedL");
   215     GLX_LOG_INFO("CGlxPreviewThumbnailBinding::HandleItemChangedL()");
   214     GLX_LOG_INFO("CGlxPreviewThumbnailBinding::HandleItemChangedL()");
   216     
   215     
   217     iTimerTicked = EFalse;
   216     iTimerTicked = EFalse;
   218     iPopulateListTNs = aPopulateListTNs;
       
   219     iIsRefreshNeeded = aIsRefreshNeeded;
   217     iIsRefreshNeeded = aIsRefreshNeeded;
   220 
   218 
   221     // remove and close old medialist   
   219     // remove and close old medialist   
   222     if( iMediaList )
   220     if( iMediaList )
   223 	    {
   221 	    {
   255     if (iTimer)
   253     if (iTimer)
   256         {
   254         {
   257         iTimer->Cancel();
   255         iTimer->Cancel();
   258         }
   256         }
   259         
   257         
   260     if (iPopulateListTNs)
   258     iTimer->Start(KThumbnailsTimeTimeDelay, KThumbnailsTimeTimeDelay,
   261         {
   259             TCallBack(IsTimeL, this));
   262         iTimer->Start(KThumbnailsTimeTimeDelay, KThumbnailsTimeTimeDelay,
   260     }
   263                 TCallBack(IsTimeL, this));
       
   264         }
       
   265      }
       
   266 
   261 
   267 // ----------------------------------------------------------------------------
   262 // ----------------------------------------------------------------------------
   268 // StopTimer - Stop the timer
   263 // StopTimer - Stop the timer
   269 // ----------------------------------------------------------------------------
   264 // ----------------------------------------------------------------------------
   270 //    
   265 //    
   322         const CGlxThumbnailAttribute* value = item.ThumbnailAttribute( 
   317         const CGlxThumbnailAttribute* value = item.ThumbnailAttribute( 
   323                 thumbnailAttribute );
   318                 thumbnailAttribute );
   324         if (value)
   319         if (value)
   325 	        {
   320 	        {
   326 	        GLX_LOG_INFO("CGlxPreviewThumbnailBinding::HandleAttributesAvailableL()");
   321 	        GLX_LOG_INFO("CGlxPreviewThumbnailBinding::HandleAttributesAvailableL()");
   327             // sometimes we get HandleAttributesAvailableL callback after some delay
   322            	StartTimer();
   328             // when we do cache cleanup. 
       
   329             if(!iPopulateListTNs)
       
   330             	{
       
   331             	iPopulateListTNs = ETrue;
       
   332             	StartTimer();
       
   333             	} 
       
   334             }
   323             }
   335         }
   324         }
   336     }
   325     }
   337     
   326     
   338 // ----------------------------------------------------------------------------
   327 // ----------------------------------------------------------------------------
   416 	TRACER("CGlxPreviewThumbnailBinding::HandlePopulatedL()");
   405 	TRACER("CGlxPreviewThumbnailBinding::HandlePopulatedL()");
   417     GLX_LOG_INFO("CGlxPreviewThumbnailBinding::HandlePopulatedL()");
   406     GLX_LOG_INFO("CGlxPreviewThumbnailBinding::HandlePopulatedL()");
   418 
   407 
   419 	// Do cache cleanup. If iIsRefreshNeeded is set,
   408 	// Do cache cleanup. If iIsRefreshNeeded is set,
   420 	// then clean up the item at 0th index 
   409 	// then clean up the item at 0th index 
   421 	if (iPopulateListTNs && iIsRefreshNeeded)
   410 	if (iIsRefreshNeeded)
   422 		{
   411 		{
   423 		if (iMediaList && iMediaList->Count() > 0)
   412 		if (iMediaList && iMediaList->Count() > 0)
   424 			{
   413 			{
   425 			GLX_LOG_INFO("**** Cache Cleanup ****");
   414 			GLX_LOG_INFO("**** Cache Cleanup ****");
   426 			MGlxCache* cacheManager = MGlxCache::InstanceL();
   415 			MGlxCache* cacheManager = MGlxCache::InstanceL();