mpxmusicplayer/app/src/mpxappui.cpp
changeset 5 2a40e88564c8
parent 4 beaa16f65879
child 9 13afc0e517bd
equal deleted inserted replaced
4:beaa16f65879 5:2a40e88564c8
  2638                         MMPXSource* s = iPlaybackUtility->Source();
  2638                         MMPXSource* s = iPlaybackUtility->Source();
  2639                         if( s && cPath->Levels() > 2 )
  2639                         if( s && cPath->Levels() > 2 )
  2640                             {
  2640                             {
  2641                             CMPXCollectionPlaylist* pl = s->PlaylistL();
  2641                             CMPXCollectionPlaylist* pl = s->PlaylistL();
  2642                             TInt browsePathCount = cPath->Count();
  2642                             TInt browsePathCount = cPath->Count();
  2643 
  2643                             													
  2644                             if (pl &&
  2644                             if( pl )
  2645                                 browsePathCount > 0) // don't set index since this playlist
       
  2646                                                      // no longer contains any items, this can
       
  2647                                                      // happen in the case of autoplaylists and cause
       
  2648                                                      // a hang
       
  2649                                 {
  2645                                 {
  2650                                 CleanupStack::PushL( pl );
  2646                                 CleanupStack::PushL( pl );
  2651                                 TInt playlistIndex = pl->Path().Index();
  2647                                 if( browsePathCount > 0 ) // don't set index since this playlist
  2652                                 if(playlistIndex < browsePathCount)
  2648                                                           // no longer contains any items, this can
       
  2649                                                           // happen in the case of autoplaylists and cause
       
  2650                                                           // a hang
  2653                                     {
  2651                                     {
  2654                                     iCollectionUtility->Collection().CommandL(EMcCmdSelect,
  2652                                     TInt playlistIndex = pl->Path().Index();
  2655                                                                               playlistIndex);
  2653                                     if(playlistIndex < browsePathCount)
  2656                                     }
  2654                                         {
       
  2655                                         iCollectionUtility->Collection().CommandL(EMcCmdSelect,
       
  2656                                                                                   playlistIndex);
       
  2657                                         }
       
  2658                                     }                                
  2657                                 CleanupStack::PopAndDestroy( pl );
  2659                                 CleanupStack::PopAndDestroy( pl );
  2658                                 }
  2660                                 }
  2659                             }
  2661                             }
  2660                         }
  2662                         }
  2661 
  2663 
  2758                     // happen in the case of autoplaylists and cause
  2760                     // happen in the case of autoplaylists and cause
  2759                     // a hang
  2761                     // a hang
  2760                     //
  2762                     //
  2761                     // Make sure we are the same level and the same container before making index call
  2763                     // Make sure we are the same level and the same container before making index call
  2762                     //
  2764                     //
  2763                     if (pl &&
  2765                     if( pl )
  2764                         browsePathCount > 0 &&
  2766                         {                    	
  2765                         levels == pl->Path().Levels() &&
       
  2766                         cPath->Id(levels-2) == pl->Path().Id(levels-2) )
       
  2767                         {
       
  2768                         CleanupStack::PushL( pl );
  2767                         CleanupStack::PushL( pl );
  2769                         TInt playlistIndex = pl->Path().Index();
  2768                         if ( browsePathCount > 0 &&
  2770 
  2769                             levels == pl->Path().Levels() &&
  2771                         if(playlistIndex < browsePathCount)
  2770                             cPath->Id(levels-2) == pl->Path().Id(levels-2) )
  2772                             {
  2771                             {
  2773                             iCollectionUtility->Collection().CommandL(EMcCmdSelect,
  2772                             TInt playlistIndex = pl->Path().Index();
  2774                                                                      playlistIndex);
  2773 
       
  2774                             if(playlistIndex < browsePathCount)
       
  2775                                 {
       
  2776                                 iCollectionUtility->Collection().CommandL(EMcCmdSelect,
       
  2777                                                                          playlistIndex);
       
  2778                                 }
  2775                             }
  2779                             }
  2776                         CleanupStack::PopAndDestroy( pl );
  2780                         CleanupStack::PopAndDestroy( pl );
  2777                         }
  2781                         }
  2778                     }
  2782                     }
  2779 
  2783 
  3658                     iPlaybackUtility->CommandL( EPbCmdClose );
  3662                     iPlaybackUtility->CommandL( EPbCmdClose );
  3659                     }
  3663                     }
  3660                 needToExit = ETrue;
  3664                 needToExit = ETrue;
  3661                 }
  3665                 }
  3662 
  3666 
  3663             if( aCommand == EAknCmdExit )
  3667 
  3664                 {
       
  3665                 // Options/Exit selected, close also the MM suite
       
  3666                 LaunchMmViewL( KMmMessage );
       
  3667                 }
       
  3668             if( needToExit )
  3668             if( needToExit )
  3669                 {
  3669                 {
  3670                 Exit();
  3670                 Exit();
  3671                 }
  3671                 }
  3672             break;
  3672             break;