photosgallery/contentharvesterplugin/src/glxcontentharvesterpluginalbums.cpp
changeset 1 9ba538e329bd
parent 0 4e91876724a2
child 2 7d9067c6fcb1
equal deleted inserted replaced
0:4e91876724a2 1:9ba538e329bd
    69     TRACER( "CGlxContentHarvesterPluginAlbums::ConstructL" );
    69     TRACER( "CGlxContentHarvesterPluginAlbums::ConstructL" );
    70     
    70     
    71     //Call the base class ConstructL
    71     //Call the base class ConstructL
    72     CGlxContentHarvesterPluginBase::ConstructL(EMbmGlxiconsQgn_prop_image_notcreated);
    72     CGlxContentHarvesterPluginBase::ConstructL(EMbmGlxiconsQgn_prop_image_notcreated);
    73     
    73     
    74     iPeriodic = CPeriodic::NewL( CActive::EPriorityLow );
    74     iPeriodic = CPeriodic::NewL( CActive::EPriorityLow );    
    75     iThumbnailContext = CGlxThumbnailContext::NewL(&iThumbnailIterator);
    75        
    76         
    76     iUriAttributeContext = new (ELeave) CGlxAttributeContext(&iThumbnailIterator); 
       
    77     iThumbnailAttributeContext = new (ELeave) CGlxAttributeContext(&iThumbnailIterator); 
       
    78     
    77     //Register/Subscribe with matrix menu for the notifications 
    79     //Register/Subscribe with matrix menu for the notifications 
    78     GetInterfaceForNotificationL();
    80     GetInterfaceForNotificationL();
    79     SetupPublisherL(KItemIndexAlbums);
    81     SetupPublisherL(KItemIndexAlbums);
    80     RequestCpsNotificationL(KItemIndexAlbums);
    82     RequestCpsNotificationL(KItemIndexAlbums);
    81     HandleStateChangeL(KItemIndexAlbums);
    83     HandleStateChangeL(KItemIndexAlbums);
   435     TRACER( "CGlxContentHarvesterPluginAlbums::DestroyMedialist" );
   437     TRACER( "CGlxContentHarvesterPluginAlbums::DestroyMedialist" );
   436     if( iMediaList )
   438     if( iMediaList )
   437         {
   439         {
   438         GLX_LOG_INFO("CGlxContentHarvesterPluginAlbums::DestroyMedialist,media list deleted");
   440         GLX_LOG_INFO("CGlxContentHarvesterPluginAlbums::DestroyMedialist,media list deleted");
   439         RemoveContextAndObserver();
   441         RemoveContextAndObserver();
   440         delete iThumbnailContext;
   442         
   441         iThumbnailContext = NULL;
   443         delete iUriAttributeContext;
       
   444         iUriAttributeContext = NULL;
       
   445         delete iThumbnailAttributeContext;
       
   446         iThumbnailAttributeContext = NULL;
       
   447         
   442         iMediaList->Close();
   448         iMediaList->Close();
   443         iMediaList = NULL;
   449         iMediaList = NULL;
   444         }
   450         }
   445     }
   451     }
   446 
   452 
   461             }
   467             }
   462         else
   468         else
   463             {
   469             {
   464             iThumbnailIterator.SetRange( KSinglePreviewThumbnail );
   470             iThumbnailIterator.SetRange( KSinglePreviewThumbnail );
   465             }
   471             }
   466 
   472         iMediaList = CreateMedialistAndAttributeContextL( TGlxMediaId( 
   467         iMediaList = CreateMedialistAndThumbnailContextL( TGlxMediaId( 
   473                         KGlxCollectionPluginAlbumsImplementationUid ),
   468                 KGlxCollectionPluginAlbumsImplementationUid ),iThumbnailContext);
   474                         iUriAttributeContext,iThumbnailAttributeContext);         
       
   475         
   469         AddContextAndObserverL();
   476         AddContextAndObserverL();
   470         }
   477         }
   471     }
   478     }
   472 
   479 
   473 // ---------------------------------------------------------------------------
   480 // ---------------------------------------------------------------------------
   540     {
   547     {
   541     TRACER( "CGlxContentHarvesterPluginAlbums::AddRemoveContextAndObserverL" );   
   548     TRACER( "CGlxContentHarvesterPluginAlbums::AddRemoveContextAndObserverL" );   
   542     if(iMediaList)
   549     if(iMediaList)
   543         {
   550         {
   544         iMediaList->AddMediaListObserverL( this );
   551         iMediaList->AddMediaListObserverL( this );
   545         iMediaList->AddContextL(iThumbnailContext, KGlxFetchContextPriorityNormal);
   552         iMediaList->AddContextL(iUriAttributeContext, KGlxFetchContextPriorityNormal);
   546         }
   553         iMediaList->AddContextL(iThumbnailAttributeContext, KGlxFetchContextPriorityLow);        
   547     }
   554         }
   548 
   555     }
   549 // ---------------------------------------------------------------------------
   556 
       
   557 // ---------------------------------------------------------------------------c
   550 // CGlxContentHarvesterPluginAlbums::RemoveContextAndObserver
   558 // CGlxContentHarvesterPluginAlbums::RemoveContextAndObserver
   551 // ---------------------------------------------------------------------------
   559 // ---------------------------------------------------------------------------
   552 //
   560 //
   553 void CGlxContentHarvesterPluginAlbums::RemoveContextAndObserver()
   561 void CGlxContentHarvesterPluginAlbums::RemoveContextAndObserver()
   554     {
   562     {
   555     TRACER( "CGlxContentHarvesterPluginAlbums::RemoveContextAndObserver" );   
   563     TRACER( "CGlxContentHarvesterPluginAlbums::RemoveContextAndObserver" );   
   556     if(iMediaList)
   564     if(iMediaList)
   557         {
   565         {
   558         iMediaList->RemoveMediaListObserver( this );
   566         iMediaList->RemoveMediaListObserver( this );
   559         iMediaList->RemoveContext(iThumbnailContext);
   567         iMediaList->RemoveContext(iUriAttributeContext);
       
   568         iMediaList->RemoveContext(iThumbnailAttributeContext);        
   560         }
   569         }
   561     }
   570     }
   562 
   571 
   563 // ---------------------------------------------------------------------------
   572 // ---------------------------------------------------------------------------
   564 // CGlxContentHarvesterPluginAlbums::HandleError
   573 // CGlxContentHarvesterPluginAlbums::HandleError