Revision: 201001 PDK_3.0.f
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 26 Jan 2010 11:56:33 +0200
changeset 4 beaa16f65879
parent 3 3f752ecfeea4
child 5 2a40e88564c8
Revision: 201001 Kit: 201004
mpxmusicplayer/app/src/mpxappui.cpp
mpxmusicplayer/commonui/src/mpxalbumartutil.cpp
mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp
mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbhandler.cpp
mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbplugin.cpp
mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp
mpxplugins/viewplugins/views/collectionview/src/mpxcollectionviewimp.cpp
mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h
mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp
mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp
mpxplugins/viewplugins/views/commoncontainer/src/mpxcommoncontainertexturemanager2.cpp
mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp
mpxplugins/viewplugins/views/commonplaybackview/src/mpxplaybackviewinfolabel.cpp
mpxplugins/viewplugins/views/upnpbrowsedialog/src/mpxupnpbrowsedialog.cpp
--- a/mpxmusicplayer/app/src/mpxappui.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxmusicplayer/app/src/mpxappui.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -3762,7 +3762,7 @@
                 MPXTlsHelper::SetFilePath( savedFile );
                 }
 
-            if ( !abort && !aiwExecuted )
+            if ( !abort && !aiwExecuted && iView )
                 {
                 if ( aCommand == EMPXCmdSaveForUseAsRingtone )
                     {
--- a/mpxmusicplayer/commonui/src/mpxalbumartutil.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxmusicplayer/commonui/src/mpxalbumartutil.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -317,11 +317,16 @@
             {
             CThumbnailObjectSource* source = CThumbnailObjectSource::NewLC( album, KMPXAlbumMimeType );
             TInt ret = NULL;
-            if(iThumbnailManager && iReqId >0)
+            TInt err = KErrNone;
+            if(iThumbnailManager )
                 {
-                iThumbnailManager->CancelRequest( iReqId );
+                if(iReqId >0)
+                    {	
+                    iThumbnailManager->CancelRequest( iReqId );
+                    }
+                TRAP(err, iReqId = TInt (iThumbnailManager->GetThumbnailL( *source, (TAny*)ret)));
                 }   
-            TRAPD(err, iReqId = TInt (iThumbnailManager->GetThumbnailL( *source, (TAny*)ret)));
+
             if( err != KErrNone)
                 {
                 User::Leave( KErrNotFound );
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbhgplugin/src/mpxdbhandler.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -788,7 +788,7 @@
             {
             MPX_DEBUG1("    EMPXMediaGeneralCount");
 
-            attributes.Append(TMPXAttribute(KMPXMediaIdGeneral, attributeId & !EMPXMediaGeneralCount));
+            attributes.Append(TMPXAttribute(KMPXMediaIdGeneral, attributeId & ~EMPXMediaGeneralCount));
 
             tryGetSongCount = ETrue;
             break;
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbhandler.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitedbplugin/src/mpxdbhandler.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -788,7 +788,7 @@
             {
             MPX_DEBUG1("    EMPXMediaGeneralCount");
             
-            attributes.Append(TMPXAttribute(KMPXMediaIdGeneral, attributeId & !EMPXMediaGeneralCount));
+            attributes.Append(TMPXAttribute(KMPXMediaIdGeneral, attributeId & ~EMPXMediaGeneralCount));
                        
             tryGetSongCount = ETrue;
             break;
--- a/mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbplugin.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/serviceplugins/collectionplugins/mpxsqlitepodcastdbplugin/src/mpxpodcastdbplugin.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -2722,8 +2722,11 @@
         }
     else // Single item
         {
-        visibleChange = iDbHandler->UpdateEpisodeL(*task, msgArray);
-        done = ETrue;
+        if(iDbHandler)
+            {		
+            visibleChange = iDbHandler->UpdateEpisodeL(*task, msgArray);
+            done = ETrue;
+            }
         }
     iActiveTask->SetVisibleChange(visibleChange);
     return done;
@@ -2790,7 +2793,7 @@
     MPX_FUNC("CMPXPodcastDbPlugin::DoHandleChangeL");
 
     TMPXCommandId cmdId = iActiveTask->GetTask();
-    if((iActiveTask->GetVisibleChange() | CMPXDbActiveTask::EAllVisible)
+    if((iActiveTask->GetVisibleChange() & CMPXDbActiveTask::EAllVisible)
         && (cmdId == KMPXCommandIdCollectionSet ||
             cmdId == KMPXCommandIdCollectionAdd ||
             cmdId == KMPXCommandIdCollectionRemove ||
--- a/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/serviceplugins/playbackplugins/progressdownloadsb/src/mpxprogressdownloadsb.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -972,137 +972,144 @@
         case MStreamControlObserver::KStateChangedEvent:
             {
             MStreamControl* control1 = (MStreamControl*)(aControl);
-            MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged[%d]",control1->GetState());
-
-            MStateChangedEvent* event = (MStateChangedEvent*)aEventObject;
-            switch( event->GetState())
+            if(aEventObject && control1)
                 {
-                case MStreamControl::INITIALIZED:
-                    MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[INITIALIZED]");
-                    if( event->GetErrorCode() == KErrNone && iState == EStateInitialising )
-                        {
-                        delete iDrmCustomCommand;
-                        iDrmCustomCommand = NULL;
-                        iDrmCustomCommand = (RMMFDRMCustomCommands*)iMStreamControl->CustomInterface(KUidInterfaceMMFDRMControl);
-
-                        if ( iDrmCustomCommand )
+                MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged[%d]",control1->GetState());
+                MStateChangedEvent* event = (MStateChangedEvent*)aEventObject;
+                switch(event->GetState())
+                    {
+                    case MStreamControl::INITIALIZED:
+                        MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[INITIALIZED]");
+                        if( event->GetErrorCode() == KErrNone && iState == EStateInitialising )
                             {
-                            TInt drmCCErr = iDrmCustomCommand->DisableAutomaticIntent(ETrue);
-                            // TODO:
-                            // for wmdrm pdl, we need to let helix consume rights.
-                            // by calling ExecuteIntent() when playback completes.
+                            delete iDrmCustomCommand;
+                            iDrmCustomCommand = NULL;
+                            iDrmCustomCommand = (RMMFDRMCustomCommands*)iMStreamControl->CustomInterface(KUidInterfaceMMFDRMControl);
+
+                            if ( iDrmCustomCommand )
+                                {
+                                TInt drmCCErr = iDrmCustomCommand->DisableAutomaticIntent(ETrue);
+                                // TODO:
+                                // for wmdrm pdl, we need to let helix consume rights.
+                                // by calling ExecuteIntent() when playback completes.
+                                }
+                            iState = EStateInitialised;
+                            // Restore volume level
+                            TInt currentVol( 0 );
+                            MPX_TRAPD( volError, currentVol = iVolumeWatcher->CurrentValueL() );
+                            if ( volError == KErrNone )
+                                {
+                                SetVolume( currentVol );
+                                TBool mute( EFalse);
+                                MPX_TRAPD( muteError, mute = iMuteWatcher->CurrentValueL() );
+                                if ( muteError == KErrNone && mute )
+                                    {
+                                    SetMute(mute);
+                                    }
+                                }
+                            iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPActive, ETrue, event->GetErrorCode());
+                            iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPaused, 0, event->GetErrorCode());
                             }
-                        iState = EStateInitialised;
-                        // Restore volume level
-                        TInt currentVol( 0 );
-                        MPX_TRAPD( volError, currentVol = iVolumeWatcher->CurrentValueL() );
-                        if ( volError == KErrNone )
+                        else if ( event->GetErrorCode() == KErrEof ) // Playback Complete
                             {
-                            SetVolume( currentVol );
-                            TBool mute( EFalse);
-                            MPX_TRAPD( muteError, mute = iMuteWatcher->CurrentValueL() );
-                            if ( muteError == KErrNone && mute )
+                            MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged[PlaybackComplete] errorcode=%d",event->GetErrorCode());
+                            if ( iDownloadState == EPbDlStateDownloadCompleted && !iFileSaved )
                                 {
-                                SetMute(mute);
+                                if ( event->GetErrorCode() == KErrEof )
+                                    {
+                                    ConsumeRights( ContentAccess::EStop );
+                                    }
+                                else
+                                    {
+                                    ConsumeRights( ContentAccess::EPause );
+                                    }
+                                MoveDownloadedFileToMusicFolderL();
                                 }
                             }
-                        iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPActive, ETrue, event->GetErrorCode());
-                        iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPaused, 0, event->GetErrorCode());
-                        }
-                    else if ( event->GetErrorCode() == KErrEof ) // Playback Complete
-                        {
-                        MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged[PlaybackComplete] errorcode=%d",event->GetErrorCode());
-                        if ( iDownloadState == EPbDlStateDownloadCompleted && !iFileSaved )
+                        else if ( event->GetErrorCode() == KErrDied || event->GetErrorCode() == KErrInUse ||
+                                event->GetErrorCode() == KErrAccessDenied )
+                            {
+                            iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
+                                    0, event->GetErrorCode() );
+                            }
+                        else
+                            {
+                            //Todo: Error cases such as no rights to play.
+                            iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPlayComplete, 0, event->GetErrorCode());
+                            }
+                        break;
+                    case MStreamControl::CLOSED:
+                        MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Closed]");
+                        //         if ( iDownloadState == EPbDlStateDownloadCompleted )
+                        //             {
+                        //             MoveDownloadedFileToMusicFolderL();	//The file should be moved somewhere else.
+                        //             }
+                        iErrorOfStreamClosedEvent = event->GetErrorCode();
+                        iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPClosed, 0, event->GetErrorCode() );
+                        break;
+                    case MStreamControl::PRIMED:
+                        MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Primed]");
+                        TInt64 duration;
+                        if (iMStreamControl->GetDuration(duration) != KErrUnknown )
                             {
-                            if ( event->GetErrorCode() == KErrEof )
-                                {
-                                ConsumeRights( ContentAccess::EStop );
-                                }
-                            else
-                                {
-                                ConsumeRights( ContentAccess::EPause );
-                                }
-                            MoveDownloadedFileToMusicFolderL();
+                            MPX_DEBUG2("CMPXProgressDownloadSB::Event:KDurationChangedEvent Duration = %d", I64INT(duration));
+                            iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPDurationChanged, duration / KPbMilliMultiplier, KErrNone);
+                            }
+                        break;
+                    case MStreamControl::EXECUTING://Playing
+                        {
+                        MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Playing]");
+                        iStreamBuffering = EFalse;
+                        iPlaying = ETrue;
+                        // Send the Started-message here since View may not have been initialized earlier.
+                        TUint expectedFileSize = 0;
+                        iMAudioProgDLSource->GetExpectedFileSize(expectedFileSize);
+                        iDownloadSize = expectedFileSize;
+                        iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPDownloadStarted,
+                                iDownloadSize,
+                                KErrNone );
+
+                        if ( iDownloadState == EPbDlStateBuffering )
+                            {
+                            iDownloadState = EPbDlStateDownloading;
+                            iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPDownloadStateChanged, iDownloadState, KErrNone);
+                            }
+                        iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPlaying, 0, event->GetErrorCode());
+                        TInt64 duration;
+                        if (iMStreamControl->GetDuration(duration) != KErrUnknown )
+                            {
+                            MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged Duration = %d", I64INT(duration));
+                            iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPDurationChanged, duration / KPbMilliMultiplier, KErrNone);
                             }
                         }
-                    else if ( event->GetErrorCode() == KErrDied || event->GetErrorCode() == KErrInUse ||
-                            event->GetErrorCode() == KErrAccessDenied )
-                        {
-                        iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPaused,
-                                                 0, event->GetErrorCode() );
-                        }
-                    else
-                        {
-                        //Todo: Error cases such as no rights to play.
-                        iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPPlayComplete, 0, event->GetErrorCode());
-                        }
-                    break;
-                case MStreamControl::CLOSED:
-                    MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Closed]");
-           //         if ( iDownloadState == EPbDlStateDownloadCompleted )
-           //             {
-           //             MoveDownloadedFileToMusicFolderL();	//The file should be moved somewhere else.
-           //             }
-                    iErrorOfStreamClosedEvent = event->GetErrorCode();
-                    iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPClosed, 0, event->GetErrorCode() );
-                    break;
-                case MStreamControl::PRIMED:
-                    MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Primed]");
-                    TInt64 duration;
-                    if (iMStreamControl->GetDuration(duration) != KErrUnknown )
-                        {
-                        MPX_DEBUG2("CMPXProgressDownloadSB::Event:KDurationChangedEvent Duration = %d", I64INT(duration));
-                        iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPDurationChanged, duration / KPbMilliMultiplier, KErrNone);
-                        }
-                    break;
-                case MStreamControl::EXECUTING://Playing
-                    {
-                    MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Playing]");
-                    iStreamBuffering = EFalse;
-                    iPlaying = ETrue;
-                 // Send the Started-message here since View may not have been initialized earlier.
-                	TUint expectedFileSize = 0;
-                	iMAudioProgDLSource->GetExpectedFileSize(expectedFileSize);
-                	iDownloadSize = expectedFileSize;
-                	iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPDownloadStarted,
-                	                         iDownloadSize,
-                	                         KErrNone );
-
-                    if ( iDownloadState == EPbDlStateBuffering )
-                        {
-                        iDownloadState = EPbDlStateDownloading;
+                        break;
+                    case MStreamControl::BUFFERING:
+                        MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged[Buffering] errorcode= %d",event->GetErrorCode());
+                        iStreamBuffering = ETrue;
+                        if ( iDownloadState != EPbDlStateDownloadPaused ||
+                                iDownloadState != EPbDlStateDownloadCanceled ||
+                                iDownloadState != EPbDlStateDownloadError ||
+                                iDownloadState != EPbDlStateNotDownloading
+                        )
+                            {
+                            iDownloadState = EPbDlStateBuffering;
+                            }
+                        iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPaused, 0, event->GetErrorCode());
                         iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPDownloadStateChanged, iDownloadState, KErrNone);
-                        }
-                    iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPlaying, 0, event->GetErrorCode());
-                    TInt64 duration;
-                    if (iMStreamControl->GetDuration(duration) != KErrUnknown )
-                        {
-                        MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged Duration = %d", I64INT(duration));
-                        iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPDurationChanged, duration / KPbMilliMultiplier, KErrNone);
-                        }
+                        break;
+                    case MStreamControl::PAUSED:
+                        MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Paused]");
+                        iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPaused, 0, event->GetErrorCode());
+                        break;
+                    default:
+                        break;
                     }
-                    break;
-                case MStreamControl::BUFFERING:
-                    MPX_DEBUG2("CMPXProgressDownloadSB::Event:EStateChanged[Buffering] errorcode= %d",event->GetErrorCode());
-                    iStreamBuffering = ETrue;
-                    if ( iDownloadState != EPbDlStateDownloadPaused ||
-                         iDownloadState != EPbDlStateDownloadCanceled ||
-                         iDownloadState != EPbDlStateDownloadError ||
-                         iDownloadState != EPbDlStateNotDownloading
-                         )
-                        {
-                        iDownloadState = EPbDlStateBuffering;
-                        }
-                    iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPaused, 0, event->GetErrorCode());
-                    iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPDownloadStateChanged, iDownloadState, KErrNone);
-                    break;
-                case MStreamControl::PAUSED:
-                    MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged[Paused]");
-                    iObs->HandlePluginEvent(MMPXPlaybackPluginObserver::EPPaused, 0, event->GetErrorCode());
-                    break;
-                default:
-                    break;
                 }
+            else
+                {
+                MPX_DEBUG1("CMPXProgressDownloadSB::Event:EStateChanged aEventObject is KNullDesC");
+                MPX_DEBUG1(" Code should not reach here as aEventObject is NULL");
+                }      
             }
             break;
 
@@ -1119,6 +1126,8 @@
         case MSourceControlObserver::KDownloadStatusChangedEvent:
             {
             MProgDLSource* control1 = (MProgDLSource*)(aControl);
+            if( control1) 
+             {
             MPX_DEBUG2("CMPXProgressDownloadSB::Event:DownloadStatus[%d]",control1->GetDownloadStatus());
             switch ( control1->GetDownloadStatus() )
                 {
@@ -1210,13 +1219,20 @@
                 default:
                   break;
                 }
+             }
+             else
+                {
+                MPX_DEBUG1("CMPXProgressDownloadSB::Event:DownloadStatus control1 is KNullDesC");
+				MPX_DEBUG1("Code should not reach here, as control1 is NULL"); 
+                }
             }
             break;
 
         case MSourceControlObserver::KFileMoveCompleteEvent:
             {
             MPX_DEBUG1("CMPXProgressDownloadSB::Event:KFileMoveCompleteEvent");
-
+            if( aEventObject)
+             {            
             MErrorCode* errorObj = (MErrorCode*)aEventObject;
             TInt fileMoveError = errorObj->GetErrorCode();
 
@@ -1248,6 +1264,12 @@
                 {
                 iObs->HandlePluginEvent( MMPXPlaybackPluginObserver::EPDownloadFileMoved, (TInt)iPdPath, KErrNone);
                 }
+              }
+            else
+             {
+             	 MPX_DEBUG1("CMPXProgressDownloadSB::Event:KFileMoveCompleteEvent aEventObject is KNullDesC");
+               MPX_DEBUG1(" Code should not reach here as aEventObject is NULL");
+             }    
             break;
             }
         case MSourceControlObserver::KPercentageDownloadedChangedEvent:
--- a/mpxplugins/viewplugins/views/collectionview/src/mpxcollectionviewimp.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionview/src/mpxcollectionviewimp.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -959,7 +959,7 @@
                 iIsWaitNoteCanceled = EFalse;
               
             
-            if(iContainer->Common()->FindBoxVisibility())
+            if( iContainer && iContainer->Common()->FindBoxVisibility())
                 {
                 iContainer->Common()->EnableFindBox(EFalse);
                 }
@@ -3355,7 +3355,9 @@
     {
     MPX_FUNC( "CMPXCollectionViewImp::UpdateDatabaseFlagL" );
     MPX_DEBUG3( "CMPXCollectionViewImp::UpdateDatabaseFlagL aFlag = 0x%x, aSet = %d", aFlag, aSet );
-    CMPXCommonListBoxArrayBase* array( iContainer->Common()->ListBoxArray() );
+    CMPXCommonListBoxArrayBase* array(0);
+    if (iContainer)
+    	array = iContainer->Common()->ListBoxArray();
     ASSERT( array );
 
     // set the item as invalid
@@ -3898,9 +3900,12 @@
     iIncrementalOpenUtil->SetDelay( KIncrementalDelayHalfSecond );
     CleanupStack::PopAndDestroy( &attrs );
 
+    if (iContainer)
+     {	 
     // Default empty text
     iContainer->Common()->SetLbxEmptyTextL( KNullDesC );
     iContainer->Common()->CoeControl()->DrawDeferred();
+      }
     iFirstIncrementalBatch = ETrue;
     }
 
@@ -5465,8 +5470,8 @@
                     {
                     aCommand = EMPXCmdPlay;
                     }
-                if ( EPbStateNotInitialised == state ||
-                     EPbStateStopped == state )
+                if (iContainer && (EPbStateNotInitialised == state ||
+                     EPbStateStopped == state ))
                     {
                     // Needed to reset the status of iPreservedState
                     if ( EPbStateStopped == state )
--- a/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/inc/mpxcollectionviewhgcontainer.h	Tue Jan 26 11:56:33 2010 +0200
@@ -767,6 +767,8 @@
     TBool                           iReady;
     TBool                           iIsEmbedded;
 
+    CAknPopupList* iDialog; // Album tracks dielog. owned.
+    
     THgScrollDirection iDirection;
     RArray<TBool> iThumbnailReqMap;
 
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgcontainer.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -732,6 +732,14 @@
             }
         else if ( aType == KEikDynamicLayoutVariantSwitch )
             {
+            if ( iCurrentViewType == EMPXViewCoverFlow )
+                {
+                if ( iDialog ) 
+                    {
+                    iDialog->CancelPopup();
+                    iDialog = NULL;
+                    }                
+                }
             if( iCurrentViewType == EMPXViewTBone )
                 {
 				iCollectionUtility->Collection().BackL();
@@ -1479,6 +1487,7 @@
     if( iContext == EContextGroupAlbum ||
         iContext == EContextGroupArtist ||
         iContext == EContextGroupSong ||
+        iContext == EContextItemPlaylist ||
         iContext == EContextGroupGenre )
         {
         iListWidget->EnableScrollBufferL(*this, KMPXListBufferSize, KMPXListBufferSize/4);
@@ -4171,14 +4180,14 @@
     CAknSinglePopupMenuStyleListBox* listBox = new ( ELeave ) CAknSinglePopupMenuStyleListBox;
     CleanupStack::PushL( listBox );
 
-    CAknPopupList* dialog = CAknPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
+    iDialog = CAknPopupList::NewL(listBox, R_MPX_COLLECTION_ALBUMSONGS_LIST_CBA,
             AknPopupLayouts::EDynMenuWindow );
 
-	CleanupStack::PushL( dialog );
-
-    listBox->ConstructL( dialog,
+	CleanupStack::PushL( iDialog );
+
+    listBox->ConstructL( iDialog,
             EAknListBoxSelectionList | EAknListBoxScrollBarSizeExcluded  );
-	CleanupStack::Pop( dialog );
+	
 
     listBox->CreateScrollBarFrameL( ETrue );
     listBox->ScrollBarFrame()->SetScrollBarVisibilityL( CEikScrollBarFrame::EOff,
@@ -4190,7 +4199,7 @@
         const TDesC& album = iSelectedMediaInAlbumView->ValueText( KMPXMediaMusicAlbum );
             if ( album.Compare( KNullDesC ) != 0 )
             {
-            dialog->SetTitleL( album );
+            iDialog->SetTitleL( album );
             }
         }
 
@@ -4227,10 +4236,11 @@
     CTextListBoxModel* model = listBox->Model();
     model->SetItemTextArray( songList );
     model->SetOwnershipType( ELbmOwnsItemArray );
-    TBool play = dialog->ExecuteLD();
-    TInt index = listBox->CurrentItemIndex();
+    TBool play = iDialog->ExecuteLD();
+    CleanupStack::Pop( iDialog );
     if( play )
         {
+        TInt index = listBox->CurrentItemIndex();
         // If item in list was opened, we only play the selected one.
         SaveSelectedAlbumItemL(iSelectedAlbumIndex);
         // Open the selected song of album
--- a/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/collectionviewhg/src/mpxcollectionviewhgimp.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -3503,7 +3503,10 @@
     {
     MPX_FUNC( "CMPXCollectionViewHgImp::UpdateDatabaseFlagL" );
     MPX_DEBUG3( "CMPXCollectionViewHgImp::UpdateDatabaseFlagL aFlag = 0x%x, aSet = %d", aFlag, aSet );
-    CMPXCommonListBoxArrayBase* array( iContainer->ListBoxArray() );
+    CMPXCommonListBoxArrayBase* array(0);
+    if (iContainer)
+    	array = iContainer->ListBoxArray();
+    	
     ASSERT( array );
 
     // set the item as invalid
@@ -4067,9 +4070,12 @@
     iIncrementalOpenUtil->SetDelay( KIncrementalDelayHalfSecond );
     CleanupStack::PopAndDestroy( &attrs );
 
-    // Default empty text
-    iContainer->SetLbxEmptyTextL( KNullDesC );
-    iContainer->DrawDeferred();
+    if (iContainer)
+     {	 
+     // Default empty text
+     iContainer->SetLbxEmptyTextL( KNullDesC );
+     iContainer->DrawDeferred();
+     }
     iFirstIncrementalBatch = ETrue;
     }
 
@@ -5710,8 +5716,8 @@
                     {
                     aCommand = EMPXCmdPlay;
                     }
-                if ( EPbStateNotInitialised == state ||
-                     EPbStateStopped == state )
+                if (iContainer && (EPbStateNotInitialised == state ||
+                     EPbStateStopped == state ))
                     {
                     // Needed to reset the status of iPreservedState
                     if ( EPbStateStopped == state )
@@ -6715,9 +6721,10 @@
                                 if ( array->IsItemBrokenLinkL( currentItem ) ||
                                     array->IsItemCorruptedL( currentItem ) )
                                     {
-                                aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
+                                    aMenuPane->SetItemDimmed( EMPXCmdUseAsCascade, ETrue );
                                     aMenuPane->SetItemDimmed( EMPXCmdSongDetails, ETrue );
                                     aMenuPane->SetItemDimmed( EMPXCmdAlbumArt, ETrue );
+                                    aMenuPane->SetItemDimmed( EMPXCmdFindInMusicShop, ETrue ); 
                                     }
                                 else // Show this option even when song is DRM protected
                                     {
--- a/mpxplugins/viewplugins/views/commoncontainer/src/mpxcommoncontainertexturemanager2.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/commoncontainer/src/mpxcommoncontainertexturemanager2.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -48,7 +48,10 @@
     if ( iTextureMap.Find(aItemIndex) )
         {
         CFbsBitmap* const* item  = iTextureMap.Find(aItemIndex);
-        delete *item;
+        if(item)
+         {
+          delete *item;
+         }
         }
     iTextureMap.InsertL( aItemIndex, aBitmap );
     iTextureIndexMap.InsertL( (TInt32)aItemId, aItemIndex );
--- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxcommonplaybackviewimp.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -2720,7 +2720,7 @@
             }
 
     // to stop seek when music player goes to background.
-    if ( !aForeground && iIsffButtonPressed )
+    if ( iContainer && !aForeground && iIsffButtonPressed )
         {
         iIsffButtonPressed = EFalse;
         iContainer->RestoreButtons( iPlaybackState );
--- a/mpxplugins/viewplugins/views/commonplaybackview/src/mpxplaybackviewinfolabel.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/commonplaybackview/src/mpxplaybackviewinfolabel.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -148,6 +148,7 @@
     if ( iMarquee )
         {
         TBool need = NeedToScroll();
+        iMarquee->Stop();
         if ( need && !iMarquee->IsMarqueeOn() )
             {
             iMarquee->Reset();
--- a/mpxplugins/viewplugins/views/upnpbrowsedialog/src/mpxupnpbrowsedialog.cpp	Fri Jan 22 09:43:47 2010 +0200
+++ b/mpxplugins/viewplugins/views/upnpbrowsedialog/src/mpxupnpbrowsedialog.cpp	Tue Jan 26 11:56:33 2010 +0200
@@ -207,60 +207,68 @@
                         MPX_DEBUG2( "CMPXUPnPBrowseDialog::ExecuteLD() selecDifferentSubPlayer %d", selecDifferentSubPlayer);
                         }
 
-                    MMPXSource* source = iPlaybackUtility->Source();
-                    CMPXCollectionPlaylist* playlist = NULL;
-                    if ( source )
+                    if(iPlaybackUtility)
                         {
-                        playlist = source->PlaylistL();
+                        MMPXSource* source = iPlaybackUtility->Source();
+                        CMPXCollectionPlaylist* playlist = NULL;
+                        if ( source )
+                            {
+                            playlist = source->PlaylistL();
+                            if ( playlist )
+                                {
+                                CleanupStack::PushL( playlist );
+                                }
+                            }
+
+                        MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
+                        // user selects a different remote player
+                        if ( iCurrentlySelectedSubPlayerName &&
+                                selecDifferentSubPlayer )
+                            {
+                            // need to clean up the current plugin
+                            TRAP_IGNORE( manager.ClearSelectPlayersL() );
+                            }
+
+                        MPX_DEBUG3( "CMPXUPnPBrowseDialog::ExecuteLD() before call to manager.SelectSubPlayerL(%d, %d)", iPlayerUid, currentItemIndex );
+                        MPX_TRAP( errorSelectSubPlayer,
+                                manager.SelectSubPlayerL( TUid::Uid(iPlayerUid),
+                                        currentItemIndex ) );
+
+                        MPX_DEBUG2( "CMPXUPnPBrowseDialog::ExecuteLD() after manager.SelectSubPlayerL()", errorSelectSubPlayer );
+                        if ( errorSelectSubPlayer == KErrNone )
+                            {
+                            okToExit = ETrue;
+
+                            if ( selecDifferentSubPlayer )
+                                {
+                                selectedSubplayerIndex = currentItemIndex;
+                                }
+                            else // subplayer selected is the same as the current one
+                                {
+                                selectedSubplayerIndex = KErrInUse;
+                                }
+                            }
+                        else
+                            {
+                            TRAP_IGNORE( manager.ClearSelectPlayersL() );
+                            if ( playlist )
+                                {
+                                iPlaybackUtility->InitL( *playlist, EFalse );
+                                }
+
+                            DisplayErrorNoteL( R_UPNP_ERROR_PLAYER_UNAVAILABLE );
+                            }
+
                         if ( playlist )
                             {
-                            CleanupStack::PushL( playlist );
-                            }
-                        }
-
-                    MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
-                    // user selects a different remote player
-                    if ( iCurrentlySelectedSubPlayerName &&
-                         selecDifferentSubPlayer )
-                        {
-                        // need to clean up the current plugin
-                        TRAP_IGNORE( manager.ClearSelectPlayersL() );
-                        }
-
-                    MPX_DEBUG3( "CMPXUPnPBrowseDialog::ExecuteLD() before call to manager.SelectSubPlayerL(%d, %d)", iPlayerUid, currentItemIndex );
-                    MPX_TRAP( errorSelectSubPlayer,
-                          manager.SelectSubPlayerL( TUid::Uid(iPlayerUid),
-                                                    currentItemIndex ) );
-
-                    MPX_DEBUG2( "CMPXUPnPBrowseDialog::ExecuteLD() after manager.SelectSubPlayerL()", errorSelectSubPlayer );
-                    if ( errorSelectSubPlayer == KErrNone )
-                        {
-                        okToExit = ETrue;
-
-                        if ( selecDifferentSubPlayer )
-                            {
-                            selectedSubplayerIndex = currentItemIndex;
-                            }
-                        else // subplayer selected is the same as the current one
-                            {
-                            selectedSubplayerIndex = KErrInUse;
+                            CleanupStack::PopAndDestroy( playlist );
                             }
                         }
                     else
                         {
-                        TRAP_IGNORE( manager.ClearSelectPlayersL() );
-                        if ( playlist )
-                            {
-                            iPlaybackUtility->InitL( *playlist, EFalse );
-                            }
-
-                        DisplayErrorNoteL( R_UPNP_ERROR_PLAYER_UNAVAILABLE );
-                        }
-
-                    if ( playlist )
-                        {
-                        CleanupStack::PopAndDestroy( playlist );
-                        }
+                        // Should not reach here  
+                        MPX_DEBUG1( "CMPXUPnPBrowseDialog::ExecuteLD()playbackutility is NULL" );
+                        }     
                     } // if ( isSelectedItemASubplayerName )
                 } // check for boundaries
             else
@@ -285,7 +293,10 @@
                 cmd->SetTObjectValueL<TBool>(KMPXCommandGeneralDoSync, ETrue);
                 cmd->SetTObjectValueL<TInt>(KMPXCommandPlaybackGeneralType, EPbCmdUnloadNonActivePlugin);
                 cmd->SetTObjectValueL<TInt>(KMPXCommandPlaybackGeneralData, aPlayerUid);
-                iPlaybackUtility->CommandL(*cmd, NULL);
+                if(iPlaybackUtility)
+                 {
+                  iPlaybackUtility->CommandL(*cmd, NULL);
+                 } 
                 CleanupStack::PopAndDestroy(cmd);
 
                 okToExit = ETrue;
@@ -635,31 +646,38 @@
         delete iCurrentlySelectedSubPlayerName;
         iCurrentlySelectedSubPlayerName = NULL;
         }
-
-    MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
-    TMPXPlaybackPlayerType playerType;
-    TInt currentlyUsedSubPlayer;
-    MPX_DEBUG1( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() before call to manager.GetSelectionL()" );
-    MPX_TRAPD( errorSelectSubPlayer, manager.GetSelectionL( playerType,
-                                                        iCurrentlyUsedPlayer,
-                                                        currentlyUsedSubPlayer,
-                                                        iCurrentlySelectedSubPlayerName));
-    MPX_DEBUG4( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() after call to manager.GetSelectionL(%d, %d, %d)",
-                                                        playerType,
-                                                        iCurrentlyUsedPlayer.iUid,
-                                                        currentlyUsedSubPlayer );
-    if (iCurrentlySelectedSubPlayerName)
+    if(  iPlaybackUtility)
         {
-        MPX_DEBUG2( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() after call to manager.GetSelectionL(%S)",
-                                                        iCurrentlySelectedSubPlayerName );
+        MMPXPlayerManager& manager = iPlaybackUtility->PlayerManager();
+        TMPXPlaybackPlayerType playerType;
+        TInt currentlyUsedSubPlayer;
+        MPX_DEBUG1( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() before call to manager.GetSelectionL()" );
+        MPX_TRAPD( errorSelectSubPlayer, manager.GetSelectionL( playerType,
+                iCurrentlyUsedPlayer,
+                currentlyUsedSubPlayer,
+                iCurrentlySelectedSubPlayerName));
+        MPX_DEBUG4( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() after call to manager.GetSelectionL(%d, %d, %d)",
+                playerType,
+                iCurrentlyUsedPlayer.iUid,
+                currentlyUsedSubPlayer );
+        if (iCurrentlySelectedSubPlayerName)
+            {
+            MPX_DEBUG2( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() after call to manager.GetSelectionL(%S)",
+                    iCurrentlySelectedSubPlayerName );
+            }
+        if ( errorSelectSubPlayer != KErrNone  && iCurrentlySelectedSubPlayerName )
+            {
+            MPX_DEBUG2( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() after call to manager.GetSelectionL() error %d",
+                    errorSelectSubPlayer );
+            delete iCurrentlySelectedSubPlayerName;
+            iCurrentlySelectedSubPlayerName = NULL;
+            }
         }
-    if ( errorSelectSubPlayer != KErrNone  && iCurrentlySelectedSubPlayerName )
+    else
         {
-        MPX_DEBUG2( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() after call to manager.GetSelectionL() error %d",
-                                                        errorSelectSubPlayer );
-        delete iCurrentlySelectedSubPlayerName;
-        iCurrentlySelectedSubPlayerName = NULL;
-        }
+        //Should not reach here
+        MPX_DEBUG1( "CMPXUPnPBrowseDialog::RetrieveCurrentlySelectSubplayerName() iPlaybackUtility is NULL" );	
+        } 
     }
 
 // ---------------------------------------------------------------------------