diff -r 4740b34b83ce -r f56ec6ce2732 mpx/collectionframework/collectionutility/src/mpxcollectionplaylist.cpp --- a/mpx/collectionframework/collectionutility/src/mpxcollectionplaylist.cpp Tue Apr 27 17:09:22 2010 +0300 +++ b/mpx/collectionframework/collectionutility/src/mpxcollectionplaylist.cpp Tue May 11 16:40:32 2010 +0300 @@ -1256,6 +1256,19 @@ if( changeType == EMPXItemDeleted ) { refresh = ETrue; + MPX_DEBUG1("CMPXCollectionPlaylist::DoHandleCollectionChangeMessageL -- current item deleted"); + + TBool lastItemDeleted( iItemIndex == 0 && iItemIndexes.Count() == 1 ); + + if ( lastItemDeleted ) // playlist is now empty, notify observer immediately + { + MPX_DEBUG1("CMPXCollectionPlaylist::DoHandleCollectionChangeMessageL -- last playlist item deleted"); + Invalidate(); + if ( iPlObs ) + { + iPlObs->HandleCollectionPlaylistChange(KErrEof); + } + } } // Modified else if( changeType == EMPXItemModified ) @@ -1333,7 +1346,8 @@ } } - if (iAutoPlaylist && refresh) + // update playlist immediately when item is deleted in order to detect deletion of the last item in the playlist + if ( refresh && iItemIndexes.Count() > 0 ) { // For autoplaylist, affected by the event. // Path clip will never happen for autoplaylist