mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp
branchRCL_3
changeset 67 16db3449d7ba
parent 59 666f9a5a90a9
equal deleted inserted replaced
63:91d5ad76f5c6 67:16db3449d7ba
   900             PRINT2( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL SampleData numElements = %d, suid = %S" ), numElements, &suid );
   900             PRINT2( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL SampleData numElements = %d, suid = %S" ), numElements, &suid );
   901 
   901 
   902             delete iSampleData;
   902             delete iSampleData;
   903             iSampleData = NULL;
   903             iSampleData = NULL;
   904 
   904 
   905             iSampleData = HBufC8::NewL( numElements );
   905             iSampleData = HBufC8::NewL( numElements * sizeof( TUint8 ) );
   906             TPtr8 samplePtr = iSampleData->Des();
   906             TPtr8 samplePtr = iSampleData->Des();
   907             mtpTypeArray.ToDes( samplePtr );
   907             mtpTypeArray.ToDes( samplePtr );
   908             RFile sampleFile;
   908             RFile sampleFile;
   909             CleanupClosePushL( sampleFile );
   909             CleanupClosePushL( sampleFile );
   910             User::LeaveIfError( sampleFile.Replace( iRfs, suid, EFileWrite ) );
   910             User::LeaveIfError( sampleFile.Replace( iRfs, suid, EFileWrite ) );
  1520 
  1520 
  1521      // Modified content
  1521      // Modified content
  1522     PRINT( _L( "MM MTP <> Modified contents are:" ) );
  1522     PRINT( _L( "MM MTP <> Modified contents are:" ) );
  1523 
  1523 
  1524     foundMedia = FindWMPMediaLC( KMPXMediaGeneralModified, ETrue ); // + foundMedia
  1524     foundMedia = FindWMPMediaLC( KMPXMediaGeneralModified, ETrue ); // + foundMedia
       
  1525 
       
  1526     if ( !foundMedia->IsSupported( KMPXMediaArrayCount ) )
       
  1527         {
       
  1528         User::Leave( KErrNotSupported );
       
  1529         }
       
  1530 
  1525     foundItemCount = *foundMedia->Value<TInt>( KMPXMediaArrayCount );
  1531     foundItemCount = *foundMedia->Value<TInt>( KMPXMediaArrayCount );
  1526 
  1532 
  1527     PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::GetModifiedContentL() found %d Media Objects" ), foundItemCount );
  1533     PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::GetModifiedContentL() found %d Media Objects" ), foundItemCount );
  1528 
  1534 
  1529     if ( foundItemCount )
  1535     if ( foundItemCount )
  1592     CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( *searchMedia,
  1598     CMPXMedia* foundMedia = CollectionHelperL()->FindAllL( *searchMedia,
  1593         playlistAttributes.Array() );
  1599         playlistAttributes.Array() );
  1594 
  1600 
  1595     CleanupStack::PopAndDestroy( &playlistAttributes ); // - playlistAttributes
  1601     CleanupStack::PopAndDestroy( &playlistAttributes ); // - playlistAttributes
  1596     CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia
  1602     CleanupStack::PopAndDestroy( searchMedia ); // - searchMedia
  1597     CleanupStack::PushL( foundMedia ); // + foundMedia
       
  1598 
  1603 
  1599     if ( !foundMedia->IsSupported( KMPXMediaArrayCount ) )
  1604     if ( !foundMedia->IsSupported( KMPXMediaArrayCount ) )
  1600         User::Leave( KErrNotSupported );
  1605         User::Leave( KErrNotSupported );
  1601 
  1606 
  1602     TInt foundItemCount = *foundMedia->Value<TInt>( KMPXMediaArrayCount );
  1607     TInt foundItemCount = *foundMedia->Value<TInt>( KMPXMediaArrayCount );
  1603 
  1608 
  1604     CleanupStack::PopAndDestroy( foundMedia ); // - foundMedia
  1609     delete foundMedia;
       
  1610     foundMedia = NULL;
  1605 
  1611 
  1606     PRINT1( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::IsExist foundItemCount(%d)" ), foundItemCount );
  1612     PRINT1( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::IsExist foundItemCount(%d)" ), foundItemCount );
  1607     return ( foundItemCount > 0 ? ETrue : EFalse );
  1613     return ( foundItemCount > 0 ? ETrue : EFalse );
  1608     }
  1614     }
  1609 
  1615