videocollection/mpxmyvideoscollection/src/vcxmyvideosopenhandler.cpp
changeset 46 adbe7d5ba2f5
parent 28 c48470be1ba7
equal deleted inserted replaced
28:c48470be1ba7 46:adbe7d5ba2f5
   124         {
   124         {
   125         case categoryLevel:
   125         case categoryLevel:
   126             {
   126             {
   127             //we are at root level, return main level items (categories + albums)
   127             //we are at root level, return main level items (categories + albums)
   128 
   128 
   129 #ifndef VIDEO_COLLECTION_PLUGIN_TB92            
   129 #ifdef VCX_ALBUMS             
   130             iCollection.AlbumsL().CreateAlbumListL(); //async
   130             iCollection.AlbumsL().CreateAlbumListL(); //async
   131 #endif
   131 #endif
   132 
   132 
   133             // This is needed to update category counters.
   133             // This is needed to update category counters.
   134             // Goes to queue if CreateAlbumListL command goes to execution
   134             // Goes to queue if CreateAlbumListL command goes to execution
   144             
   144             
   145             itemList->SetTObjectValueL<TBool>( KVcxMediaMyVideosVideoListIsPartial,
   145             itemList->SetTObjectValueL<TBool>( KVcxMediaMyVideosVideoListIsPartial,
   146                 !iCache.IsComplete() );
   146                 !iCache.IsComplete() );
   147                 
   147                 
   148             TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.CategoriesL().iList );
   148             TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.CategoriesL().iList );
   149 #ifndef VIDEO_COLLECTION_PLUGIN_TB92
   149 #ifdef VCX_ALBUMS
   150             TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.AlbumsL().iAlbumList );
   150             TVcxMyVideosCollectionUtil::AppendToListL( *itemList, *iCollection.AlbumsL().iAlbumList );
   151 #endif
   151 #endif
   152             itemList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
   152             itemList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
   153             iCollection.iObs->HandleOpen( itemList, KErrNone );
   153             iCollection.iObs->HandleOpen( itemList, KErrNone );
   154             CleanupStack::PopAndDestroy( itemList );
   154             CleanupStack::PopAndDestroy( itemList );
   158 
   158 
   159         case videosLevel:
   159         case videosLevel:
   160             {
   160             {
   161             //we are at second level, return video list from some category or album
   161             //we are at second level, return video list from some category or album
   162 
   162 
   163 #ifndef VIDEO_COLLECTION_PLUGIN_TB92
   163 #ifdef VCX_ALBUMS
   164             iCollection.AlbumsL().CreateAlbumListL(); //async
   164             iCollection.AlbumsL().CreateAlbumListL(); //async
   165 #endif
   165 #endif
   166 
   166 
   167             TMPXItemId categoryId( aPath.Id() );
   167             TMPXItemId categoryId( aPath.Id() );
   168             
   168             
   388         // ownership of the list to client. Video objects will continue to point to the same shared data.
   388         // ownership of the list to client. Video objects will continue to point to the same shared data.
   389         iCache.ReCreateVideoListL();
   389         iCache.ReCreateVideoListL();
   390 
   390 
   391         iCollection.CategoriesL().UpdateCategoriesNewVideoNamesL();
   391         iCollection.CategoriesL().UpdateCategoriesNewVideoNamesL();
   392 
   392 
   393         iCollection.AlbumsL().CalculateAttributesL();
   393         iCollection.AlbumsL().CalculateAttributesL(); // adds events if attributes modified, does not send
   394         
   394         
   395         iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
   395         iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
   396         }
   396         }
   397     iCollection.iMessageList->SendL();
   397     iCollection.iMessageList->SendL();
   398     }
   398     }
   509     if ( iPendingAlbumOpenId == aAlbumId )
   509     if ( iPendingAlbumOpenId == aAlbumId )
   510         {
   510         {
   511         MPX_DEBUG2("CVcxMyVideosOpenHandler:: First videos for album %d arrived, calling HandleOpen()", aAlbumId);
   511         MPX_DEBUG2("CVcxMyVideosOpenHandler:: First videos for album %d arrived, calling HandleOpen()", aAlbumId);
   512         
   512         
   513         iAlbumVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
   513         iAlbumVideoList->SetCObjectValueL( KMPXMediaGeneralContainerPath, iPath );
   514         if ( aComplete )
       
   515             {
       
   516             iAlbumVideoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
       
   517                     EVcxMyVideosVideoListComplete );
       
   518             }
       
   519         iCollection.iObs->HandleOpen( iAlbumVideoList, aError );
   514         iCollection.iObs->HandleOpen( iAlbumVideoList, aError );
   520         iPendingAlbumOpenId = 0;
   515         iPendingAlbumOpenId = 0;
   521         }
   516         }
   522 
   517 
   523     if ( !aComplete )
   518     if ( !aComplete )
   524         {
   519         {
   525         iCollection.iMessageList->AddEventL( KVcxMessageMyVideosItemsAppended );
   520         iCollection.iMessageList->AddEventL( KVcxMessageMyVideosItemsAppended );
   526 
   521 
   527         MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for album %d, extra info = %d",
   522         MPX_DEBUG3("CVcxMyVideosOpenHandler:: adding modify event for album %d, extra info = %d",
   528                 aAlbumId, EVcxMyVideosVideoListOrderChanged );
   523                 aAlbumId, EVcxMyVideosVideoListOrderChanged );
   529         iCollection.iMessageList->AddEventL( TMPXItemId( aAlbumId, 2 ), EMPXItemModified,
   524         iCollection.iMessageList->AddEventL( TMPXItemId( aAlbumId, KVcxMvcMediaTypeAlbum ), EMPXItemModified,
   530                 EVcxMyVideosVideoListOrderChanged );
   525                 EVcxMyVideosVideoListOrderChanged );
   531         }
   526         }
   532     else
   527     else
   533         {
   528         {
   534         //TODO: should add album id
   529         //TODO: should add album id
   535         iCollection.AlbumsL().CalculateAttributesL();
   530         iCollection.AlbumsL().CalculateAttributesL(); // adds events if attributes modified, does not send
   536 
   531 
       
   532         iAlbumVideoList->SetTObjectValueL<TInt>( KVcxMediaMyVideosInt32Value,
       
   533                     EVcxMyVideosVideoListComplete );
   537         iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
   534         iCollection.iMessageList->AddEventL( KVcxMessageMyVideosListComplete );
   538 
   535 
   539         
   536         
   540         delete iAlbumVideoList;
   537         delete iAlbumVideoList;
   541         iAlbumVideoList = NULL;
   538         iAlbumVideoList = NULL;