photosgallery/contentharvesterplugin/src/glxcontentharvesterplugindownloads.cpp
changeset 1 9ba538e329bd
parent 0 4e91876724a2
child 2 7d9067c6fcb1
equal deleted inserted replaced
0:4e91876724a2 1:9ba538e329bd
    73 
    73 
    74     //Call the base class ConstructL,to create the default thumbnail
    74     //Call the base class ConstructL,to create the default thumbnail
    75     CGlxContentHarvesterPluginBase::ConstructL(EMbmGlxiconsQgn_prop_image_notcreated);
    75     CGlxContentHarvesterPluginBase::ConstructL(EMbmGlxiconsQgn_prop_image_notcreated);
    76     
    76     
    77     iPeriodic = CPeriodic::NewL( CActive::EPriorityLow );
    77     iPeriodic = CPeriodic::NewL( CActive::EPriorityLow );
    78     iThumbnailContext = CGlxThumbnailContext::NewL(&iThumbnailIterator);
    78    
    79     
    79     iUriAttributeContext = new (ELeave) CGlxAttributeContext(&iThumbnailIterator); 
       
    80     iThumbnailAttributeContext = new (ELeave) CGlxAttributeContext(&iThumbnailIterator); 
       
    81 
    80     //Register/Subscribe with matrix menu for the notifications 
    82     //Register/Subscribe with matrix menu for the notifications 
    81     GetInterfaceForNotificationL();
    83     GetInterfaceForNotificationL();
    82     SetupPublisherL(KItemIndexDownloads);
    84     SetupPublisherL(KItemIndexDownloads);
    83     RequestCpsNotificationL(KItemIndexDownloads);
    85     RequestCpsNotificationL(KItemIndexDownloads);
    84     HandleStateChangeL(KItemIndexDownloads);
    86     HandleStateChangeL(KItemIndexDownloads);
   439     {
   441     {
   440     TRACER( "CGlxContentHarvesterPluginDownloads::DestroyMedialist" );
   442     TRACER( "CGlxContentHarvesterPluginDownloads::DestroyMedialist" );
   441     if( iMediaList )
   443     if( iMediaList )
   442         {
   444         {
   443         RemoveContextAndObserver();
   445         RemoveContextAndObserver();
   444         delete iThumbnailContext;
   446         
   445         iThumbnailContext = NULL;
   447         delete iUriAttributeContext;
       
   448         iUriAttributeContext = NULL;
       
   449         delete iThumbnailAttributeContext;
       
   450         iThumbnailAttributeContext = NULL;
       
   451         
   446         iMediaList->Close();
   452         iMediaList->Close();
   447         iMediaList = NULL;
   453         iMediaList = NULL;
   448         }
   454         }
   449     }
   455     }
   450 
   456 
   466         else
   472         else
   467             {
   473             {
   468             iThumbnailIterator.SetRange( KSinglePreviewThumbnail );
   474             iThumbnailIterator.SetRange( KSinglePreviewThumbnail );
   469             }
   475             }
   470 
   476 
   471         iMediaList = CreateMedialistAndThumbnailContextL( TGlxMediaId( 
   477         iMediaList = CreateMedialistAndAttributeContextL( TGlxMediaId( 
   472                 KGlxCollectionPluginDownloadsImplementationUid ),iThumbnailContext);
   478                 KGlxCollectionPluginDownloadsImplementationUid ),
       
   479                 iUriAttributeContext,iThumbnailAttributeContext);         
       
   480        
   473         AddContextAndObserverL();
   481         AddContextAndObserverL();
   474         }
   482         }
   475     }
   483     }
   476 
   484 
   477 // ---------------------------------------------------------------------------
   485 // ---------------------------------------------------------------------------
   537     {
   545     {
   538     TRACER( "CGlxContentHarvesterPluginDownloads::AddRemoveContextAndObserverL" );   
   546     TRACER( "CGlxContentHarvesterPluginDownloads::AddRemoveContextAndObserverL" );   
   539     if(iMediaList)
   547     if(iMediaList)
   540         {
   548         {
   541         iMediaList->AddMediaListObserverL( this );
   549         iMediaList->AddMediaListObserverL( this );
   542         iMediaList->AddContextL(iThumbnailContext, KGlxFetchContextPriorityNormal);
   550         iMediaList->AddContextL(iUriAttributeContext, KGlxFetchContextPriorityNormal);
       
   551         iMediaList->AddContextL(iThumbnailAttributeContext, KGlxFetchContextPriorityLow);
   543         }
   552         }
   544     }
   553     }
   545 
   554 
   546 // ---------------------------------------------------------------------------
   555 // ---------------------------------------------------------------------------
   547 // CGlxContentHarvesterPluginDownloads::RemoveContextAndObserver
   556 // CGlxContentHarvesterPluginDownloads::RemoveContextAndObserver
   551     {
   560     {
   552     TRACER( "CGlxContentHarvesterPluginDownloads::RemoveContextAndObserver" );   
   561     TRACER( "CGlxContentHarvesterPluginDownloads::RemoveContextAndObserver" );   
   553     if(iMediaList)
   562     if(iMediaList)
   554         {
   563         {
   555         iMediaList->RemoveMediaListObserver( this );
   564         iMediaList->RemoveMediaListObserver( this );
   556         iMediaList->RemoveContext(iThumbnailContext);
   565         iMediaList->RemoveContext(iUriAttributeContext);
       
   566         iMediaList->RemoveContext(iThumbnailAttributeContext); 
   557         }
   567         }
   558     }
   568     }
   559 
   569 
   560 
   570 
   561 // ---------------------------------------------------------------------------
   571 // ---------------------------------------------------------------------------