709 TX_ENTRY_ARGS( "selection count=" << count ); |
709 TX_ENTRY_ARGS( "selection count=" << count ); |
710 |
710 |
711 CMPXCollectionPath* path( iCollectionUtility->Collection().PathL() ); |
711 CMPXCollectionPath* path( iCollectionUtility->Collection().PathL() ); |
712 CleanupStack::PushL( path ); |
712 CleanupStack::PushL( path ); |
713 |
713 |
714 for ( TInt i = 0; i < count; i++ ) { |
714 if (count > 1) { |
715 path->SelectL( selection.at( i ) ); |
715 for ( TInt i = 0; i < count; i++ ){ |
|
716 path->SelectL( selection.at( i ) ); |
|
717 } |
|
718 } |
|
719 else { |
|
720 path->Set( selection.at(0) ); |
716 } |
721 } |
717 iCollectionUiHelper->DeleteL( *path, this ); |
722 iCollectionUiHelper->DeleteL( *path, this ); |
718 CleanupStack::PopAndDestroy( path ); |
723 CleanupStack::PopAndDestroy( path ); |
719 TX_EXIT |
724 TX_EXIT |
720 } |
725 } |
891 CMPXCollectionPath* path( iCollectionUtility->Collection().PathL() ); |
896 CMPXCollectionPath* path( iCollectionUtility->Collection().PathL() ); |
892 CleanupStack::PushL( path ); |
897 CleanupStack::PushL( path ); |
893 TMPXItemId collectionId( path->Id( 0 ) ); |
898 TMPXItemId collectionId( path->Id( 0 ) ); |
894 CleanupStack::PopAndDestroy( path ); |
899 CleanupStack::PopAndDestroy( path ); |
895 |
900 |
896 if ( collectionData->context() == ECollectionContextAlbums ) { |
901 if ( ( collectionData->context() == ECollectionContextAlbums ) || |
|
902 ( collectionData->context() == ECollectionContextArtistAlbums ) || |
|
903 ( collectionData->context() == ECollectionContextArtists ) ) { |
897 for ( TInt i = 0; i < count; i++ ) { |
904 for ( TInt i = 0; i < count; i++ ) { |
898 CMPXMedia* results; |
905 CMPXMedia* results; |
899 CMPXMedia* album( containerArray->AtL( selection[i] ) ); |
906 CMPXMedia* container( containerArray->AtL( selection[i] ) ); |
900 // Fetch the songs for the selected album |
907 // Fetch the songs for the selected album |
901 TMPXItemId albumId = album->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ); |
908 TMPXItemId containerId = container->ValueTObjectL<TMPXItemId>( KMPXMediaGeneralId ); |
902 CMPXMedia* findCriteria = CMPXMedia::NewL(); |
909 CMPXMedia* findCriteria = CMPXMedia::NewL(); |
903 CleanupStack::PushL( findCriteria ); |
910 CleanupStack::PushL( findCriteria ); |
904 findCriteria->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXGroup ); |
911 findCriteria->SetTObjectValueL<TMPXGeneralType>( KMPXMediaGeneralType, EMPXGroup ); |
905 findCriteria->SetTObjectValueL<TMPXGeneralCategory>( KMPXMediaGeneralCategory, EMPXSong ); |
912 findCriteria->SetTObjectValueL<TMPXGeneralCategory>( KMPXMediaGeneralCategory, EMPXSong ); |
906 findCriteria->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, albumId ); |
913 findCriteria->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, containerId ); |
907 RArray<TMPXAttribute> attrs; |
914 RArray<TMPXAttribute> attrs; |
908 CleanupClosePushL( attrs ); |
915 CleanupClosePushL( attrs ); |
909 attrs.Append( TMPXAttribute( KMPXMediaIdGeneral, |
916 attrs.Append( TMPXAttribute( KMPXMediaIdGeneral, |
910 EMPXMediaGeneralTitle | |
917 EMPXMediaGeneralTitle | |
911 EMPXMediaGeneralId ) ); |
918 EMPXMediaGeneralId ) ); |
912 attrs.Append( KMPXMediaMusicAlbumTrack ); |
919 if ( collectionData->context() == ECollectionContextArtists ){ |
|
920 attrs.Append( KMPXMediaMusicArtist ); |
|
921 } |
|
922 else { |
|
923 attrs.Append( KMPXMediaMusicAlbumTrack ); |
|
924 } |
913 results = iCollectionUtility->Collection().FindAllL( *findCriteria, attrs.Array() ); |
925 results = iCollectionUtility->Collection().FindAllL( *findCriteria, attrs.Array() ); |
914 CleanupStack::PopAndDestroy( &attrs ); |
926 CleanupStack::PopAndDestroy( &attrs ); |
915 CleanupStack::PopAndDestroy( findCriteria ); |
927 CleanupStack::PopAndDestroy( findCriteria ); |
916 CleanupStack::PushL( results ); |
928 CleanupStack::PushL( results ); |
917 |
929 |