photosgallery/viewframework/views/viewbase/src/glxmedialistviewbase.cpp
changeset 2 7d9067c6fcb1
parent 0 4e91876724a2
child 9 6b87b143d312
equal deleted inserted replaced
1:9ba538e329bd 2:7d9067c6fcb1
   160     if (!iMediaList && iMediaListFactory)
   160     if (!iMediaList && iMediaListFactory)
   161         {
   161         {
   162         iMediaList = &iMediaListFactory->CreateMediaListL(*iCollectionUtility);
   162         iMediaList = &iMediaListFactory->CreateMediaListL(*iCollectionUtility);
   163     	iMediaList->AddContextL(iPreloadContextForCommandHandlers, 0);
   163     	iMediaList->AddContextL(iPreloadContextForCommandHandlers, 0);
   164         }
   164         }
       
   165     __ASSERT_ALWAYS(iMediaList, Panic(EGlxPanicNullMediaList));
   165 
   166 
   166     if(iFixedTitle)
   167     if(iFixedTitle)
   167         {
   168         {
   168         // If there is a fixed title, set it
   169         // If there is a fixed title, set it
   169         SetTitleL(*iFixedTitle);
   170         SetTitleL(*iFixedTitle);
   179         CleanupStack::PopAndDestroy(path);
   180         CleanupStack::PopAndDestroy(path);
   180         }
   181         }
   181    
   182    
   182     //Allow the MskController to observe medialist everytime a view with a valid
   183     //Allow the MskController to observe medialist everytime a view with a valid
   183     //medialist becomes active
   184     //medialist becomes active
   184     if( iCbaControl && iMediaList && Cba()&& iEnableMidddleSoftkey )
   185     if( iCbaControl && Cba()&& iEnableMidddleSoftkey )
   185         {
   186         {
   186         CMPXCollectionPath* navigationalState = iCollectionUtility->Collection().PathL();
   187         CMPXCollectionPath* navigationalState = iCollectionUtility->Collection().PathL();
   187         CleanupStack::PushL(navigationalState);
   188         CleanupStack::PushL(navigationalState);
   188         iCbaControl->AddToObserverL(*iMediaList,Cba()); 
   189         iCbaControl->AddToObserverL(*iMediaList,Cba()); 
   189         if(!(1 == navigationalState->Levels())) // Checking for the main list view
   190         if(!(1 == navigationalState->Levels())) // Checking for the main list view
   213 // -----------------------------------------------------------------------------
   214 // -----------------------------------------------------------------------------
   214 //	
   215 //	
   215 EXPORT_C void CGlxMediaListViewBase::DoViewDeactivate()
   216 EXPORT_C void CGlxMediaListViewBase::DoViewDeactivate()
   216     {
   217     {
   217     DoMLViewDeactivate();
   218     DoMLViewDeactivate();
   218     if( iCbaControl && iMediaList && Cba() )
   219 
   219         {
   220     if( iMediaList )
   220         //Remove Mskcontroller from medialist observer
   221         {
   221         iCbaControl->RemoveFromObserver(*iMediaList);
   222         if (iCbaControl && Cba())
   222         }
   223             {
   223     if( Toolbar() && iToolbarControl )
   224             //Remove Mskcontroller from medialist observer
   224         {
   225             iCbaControl->RemoveFromObserver(*iMediaList);
   225         //Remove Toolbarcontroller from medialist observer
   226             }
   226         iToolbarControl->RemoveFromObserver(*iMediaList);
   227         if (Toolbar() && iToolbarControl)
   227         }    
   228             {
   228     
   229             //Remove Toolbarcontroller from medialist observer
   229     // Only close the medialist if navigating backwards
   230             iToolbarControl->RemoveFromObserver(*iMediaList);
   230     if ( iUiUtility->ViewNavigationDirection() == EGlxNavigationBackwards )
   231             }
   231         {
   232 
   232         CloseMediaList();
   233         // Only close the medialist if navigating backwards
       
   234         if (iUiUtility->ViewNavigationDirection() == EGlxNavigationBackwards)
       
   235             {
       
   236             CloseMediaList();
       
   237             }
   233         }
   238         }
   234 
   239 
   235     delete iTitleFetcher;
   240     delete iTitleFetcher;
   236     iTitleFetcher = NULL;
   241     iTitleFetcher = NULL;
   237     }
   242     }