diff -r ce5ada96ab30 -r 5294c000a26d videocollection/hgmyvideos/src/vcxhgmyvideosvideolistimpl.cpp --- a/videocollection/hgmyvideos/src/vcxhgmyvideosvideolistimpl.cpp Fri Mar 12 15:43:00 2010 +0200 +++ b/videocollection/hgmyvideos/src/vcxhgmyvideosvideolistimpl.cpp Mon Mar 15 12:40:47 2010 +0200 @@ -312,13 +312,16 @@ void CVcxHgMyVideosVideoListImpl::DeleteVideosL() { IPTVLOGSTRING_LOW_LEVEL( "MPX My Videos UI # CVcxHgMyVideosVideoListImpl::DeleteVideosL()" ); - RArray operationTargets; - CleanupClosePushL( operationTargets ); + RArray operationTargetIndexes; + RArray operationTargetIds; + CleanupClosePushL( operationTargetIndexes ); + CleanupClosePushL( operationTargetIds ); - GetOperationTargetIndexesL( operationTargets ); + GetOperationTargetIndexesL( operationTargetIndexes ); + OperationTargetsToMpxIdsL( operationTargetIndexes, operationTargetIds ); - if ( ConfirmDeleteVideosL( operationTargets.Count(), - iVideoModel->GetVideoName( operationTargets[0] ) ) ) + if ( ConfirmDeleteVideosL( operationTargetIndexes.Count(), + iVideoModel->GetVideoName( operationTargetIndexes[0] ) ) ) { HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll ); @@ -326,9 +329,16 @@ // in DialogDismissedL() or in VideoDeletionCompletedL(). OpenDeleteWaitNoteL(); - iVideoModel->DeleteVideosL( operationTargets ); + TRAPD( err, iVideoModel->DeleteVideosL( operationTargetIds ) ); + + if( err != KErrNone ) + { + CloseDeleteWaitNote(); + } } - CleanupStack::PopAndDestroy( &operationTargets ); + + CleanupStack::PopAndDestroy( &operationTargetIds ); + CleanupStack::PopAndDestroy( &operationTargetIndexes ); } // ----------------------------------------------------------------------------- @@ -651,14 +661,19 @@ // void CVcxHgMyVideosVideoListImpl::HandleMoveOrCopyCommandL( TBool aCopy ) { - RArray operationTargets; - CleanupClosePushL( operationTargets ); + RArray operationTargetIndexes; + RArray operationTargetIds; + CleanupClosePushL( operationTargetIndexes ); + CleanupClosePushL( operationTargetIds ); - GetOperationTargetIndexesL( operationTargets ); + GetOperationTargetIndexesL( operationTargetIndexes ); + OperationTargetsToMpxIdsL( operationTargetIndexes, operationTargetIds ); + HandleMarkCommandL( EVcxHgMyVideosCmdUnmarkAll ); - iVideoCopier->MoveOrCopyL( operationTargets, aCopy ); + iVideoCopier->MoveOrCopyL( operationTargetIds, aCopy ); - CleanupStack::PopAndDestroy( &operationTargets ); + CleanupStack::PopAndDestroy( &operationTargetIds ); + CleanupStack::PopAndDestroy( &operationTargetIndexes ); } // ----------------------------------------------------------------------------- @@ -1140,3 +1155,20 @@ return iAiwMenuHandler; } #endif + +// --------------------------------------------------------------------------- +// CVcxHgMyVideosVideoListImpl::OperationTargetsToMpxIdsL() +// --------------------------------------------------------------------------- +// +void CVcxHgMyVideosVideoListImpl::OperationTargetsToMpxIdsL( + RArray& aOperationTargetIndexes, + RArray& aOperationTargetIds ) + { + for ( TInt i = 0; i < aOperationTargetIndexes.Count(); i++ ) + { + if ( iVideoModel->GetVideoId( aOperationTargetIndexes[i] ) != KErrNotFound ) + { + aOperationTargetIds.Append( iVideoModel->GetVideoId( aOperationTargetIndexes[i] ) ); + } + } + }