880 { |
880 { |
881 TMPXItemId itemId = *media->Value<TMPXItemId>( KMPXMediaGeneralId ); |
881 TMPXItemId itemId = *media->Value<TMPXItemId>( KMPXMediaGeneralId ); |
882 |
882 |
883 if( itemId.iId2 == KVcxMvcMediaTypeAlbum ) |
883 if( itemId.iId2 == KVcxMvcMediaTypeAlbum ) |
884 { |
884 { |
885 TBool albumFound( EFalse ); |
885 int albumIndex(-1); |
886 for( TInt e = 0; e < iAlbumIds.Count(); e++ ) |
886 for( TInt e = 0; e < iAlbumIds.Count(); e++ ) |
887 { |
887 { |
888 if( iAlbumIds[e] == itemId ) |
888 if( iAlbumIds[e] == itemId ) |
889 { |
889 { |
890 albumFound = ETrue; |
890 albumIndex = e; |
891 } |
891 } |
892 } |
892 } |
893 |
893 |
894 if( !albumFound ) |
894 TBuf<256> title; |
|
895 if( media->IsSupported( KMPXMediaGeneralTitle ) ) |
895 { |
896 { |
896 TBuf<256> title; |
897 title = media->ValueText( KMPXMediaGeneralTitle ); |
897 if( media->IsSupported( KMPXMediaGeneralTitle ) ) |
898 |
|
899 if( albumIndex == -1 ) |
898 { |
900 { |
899 title = media->ValueText( KMPXMediaGeneralTitle ); |
901 HBufC* titleBuff = title.AllocL(); |
|
902 iAlbumNames.Append( titleBuff ); |
|
903 iAlbumIds.Append( itemId ); |
900 } |
904 } |
901 HBufC* titleBuff = title.AllocL(); |
905 else |
902 iAlbumNames.Append( titleBuff ); |
906 { |
903 iAlbumIds.Append( itemId ); |
907 if( iAlbumNames[albumIndex]->Compare( title )!= KErrNone ) |
|
908 { |
|
909 iAlbumNames[albumIndex]->Des().SetLength( 0 ); |
|
910 iAlbumNames[albumIndex]->ReAlloc( title.Length() ); |
|
911 iAlbumNames[albumIndex]->Des().Copy( title ); |
|
912 } |
|
913 } |
904 } |
914 } |
905 } |
915 } |
906 } |
916 } |
907 } |
917 } |
908 } |
918 } |
2891 |
2901 |
2892 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::RemoveMediasFromAlbumL"); |
2902 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::RemoveMediasFromAlbumL"); |
2893 } |
2903 } |
2894 |
2904 |
2895 // ----------------------------------------------------------------------------- |
2905 // ----------------------------------------------------------------------------- |
2896 // CVCXMyVideosCollectionPluginTester::CheckAlbumCount |
2906 // CVCXMyVideosCollectionPluginTester::RenameAlbumL |
2897 // ----------------------------------------------------------------------------- |
2907 // ----------------------------------------------------------------------------- |
2898 // |
2908 // |
2899 bool CVCXMyVideosCollectionPluginTester::CheckAlbumCount( int aExpectedCount ) |
2909 void CVCXMyVideosCollectionPluginTester::RenameAlbumL( const TDesC& aAlbumName, const TDesC& aNewAlbumName ) |
2900 { |
2910 { |
2901 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::CheckAlbumCount"); |
2911 VCXLOGLO1(">>>CVCXMyVideosCollectionPluginTester::RenameAlbumL"); |
2902 |
2912 |
2903 TBool ret( ETrue ); |
2913 TMPXItemId itemId = GetAlbumIdL( aAlbumName ); |
2904 if( iAlbumNames.Count() != aExpectedCount ) |
2914 CMPXMedia *media = CMPXMedia::NewL(); |
2905 { |
2915 CleanupStack::PushL( media ); |
2906 VCXLOGLO3("<<<CVCXMyVideosCollectionPluginTester::CheckAlbumCount: expected: %d, got: %d, error!", aExpectedCount, iAlbumNames.Count()); |
2916 media->SetTObjectValueL<TMPXItemId>( KMPXMediaGeneralId, itemId ); |
2907 ret = EFalse; |
2917 media->SetTextValueL( KMPXMediaGeneralTitle, aNewAlbumName ); |
2908 } |
2918 SetMediaL( media, ETrue ); |
2909 |
2919 CleanupStack::PopAndDestroy( media ); |
2910 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::CheckAlbumCount"); |
2920 |
2911 return ret; |
2921 VCXLOGLO1("<<<CVCXMyVideosCollectionPluginTester::RenameAlbumL"); |
2912 } |
2922 } |
2913 |
2923 |
2914 // ----------------------------------------------------------------------------- |
2924 // ----------------------------------------------------------------------------- |
2915 // CVCXMyVideosCollectionPluginTester::SetAutomaticRefresh |
2925 // CVCXMyVideosCollectionPluginTester::SetAutomaticRefresh |
2916 // ----------------------------------------------------------------------------- |
2926 // ----------------------------------------------------------------------------- |