mpxmusicplayer/app/src/mpxappui.cpp
changeset 5 2a40e88564c8
parent 4 beaa16f65879
child 11 13afc0e517bd
--- a/mpxmusicplayer/app/src/mpxappui.cpp	Tue Jan 26 11:56:33 2010 +0200
+++ b/mpxmusicplayer/app/src/mpxappui.cpp	Tue Feb 02 00:09:33 2010 +0200
@@ -2640,20 +2640,22 @@
                             {
                             CMPXCollectionPlaylist* pl = s->PlaylistL();
                             TInt browsePathCount = cPath->Count();
-
-                            if (pl &&
-                                browsePathCount > 0) // don't set index since this playlist
-                                                     // no longer contains any items, this can
-                                                     // happen in the case of autoplaylists and cause
-                                                     // a hang
+                            													
+                            if( pl )
                                 {
                                 CleanupStack::PushL( pl );
-                                TInt playlistIndex = pl->Path().Index();
-                                if(playlistIndex < browsePathCount)
+                                if( browsePathCount > 0 ) // don't set index since this playlist
+                                                          // no longer contains any items, this can
+                                                          // happen in the case of autoplaylists and cause
+                                                          // a hang
                                     {
-                                    iCollectionUtility->Collection().CommandL(EMcCmdSelect,
-                                                                              playlistIndex);
-                                    }
+                                    TInt playlistIndex = pl->Path().Index();
+                                    if(playlistIndex < browsePathCount)
+                                        {
+                                        iCollectionUtility->Collection().CommandL(EMcCmdSelect,
+                                                                                  playlistIndex);
+                                        }
+                                    }                                
                                 CleanupStack::PopAndDestroy( pl );
                                 }
                             }
@@ -2760,18 +2762,20 @@
                     //
                     // Make sure we are the same level and the same container before making index call
                     //
-                    if (pl &&
-                        browsePathCount > 0 &&
-                        levels == pl->Path().Levels() &&
-                        cPath->Id(levels-2) == pl->Path().Id(levels-2) )
-                        {
+                    if( pl )
+                        {                    	
                         CleanupStack::PushL( pl );
-                        TInt playlistIndex = pl->Path().Index();
-
-                        if(playlistIndex < browsePathCount)
+                        if ( browsePathCount > 0 &&
+                            levels == pl->Path().Levels() &&
+                            cPath->Id(levels-2) == pl->Path().Id(levels-2) )
                             {
-                            iCollectionUtility->Collection().CommandL(EMcCmdSelect,
-                                                                     playlistIndex);
+                            TInt playlistIndex = pl->Path().Index();
+
+                            if(playlistIndex < browsePathCount)
+                                {
+                                iCollectionUtility->Collection().CommandL(EMcCmdSelect,
+                                                                         playlistIndex);
+                                }
                             }
                         CleanupStack::PopAndDestroy( pl );
                         }
@@ -3660,11 +3664,7 @@
                 needToExit = ETrue;
                 }
 
-            if( aCommand == EAknCmdExit )
-                {
-                // Options/Exit selected, close also the MM suite
-                LaunchMmViewL( KMmMessage );
-                }
+
             if( needToExit )
                 {
                 Exit();