mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/csendobject.cpp
branchRCL_3
changeset 34 e257e2b6459d
parent 30 6f9f6e99a23e
child 53 e42293e811d8
equal deleted inserted replaced
30:6f9f6e99a23e 34:e257e2b6459d
   127     iReceivedObjectInfo->SetUint( CMTPObjectMetaData::EDataProviderId,
   127     iReceivedObjectInfo->SetUint( CMTPObjectMetaData::EDataProviderId,
   128         iFramework.DataProviderId() );
   128         iFramework.DataProviderId() );
   129 
   129 
   130     PRINT1( _L( "MM MTP <> CSendObject::ConstructL DataProviderId = 0x%x" ), iFramework.DataProviderId());
   130     PRINT1( _L( "MM MTP <> CSendObject::ConstructL DataProviderId = 0x%x" ), iFramework.DataProviderId());
   131 
   131 
   132   
       
   133     PRINT( _L( "MM MTP <= CSendObject::ConstructL" ) );
   132     PRINT( _L( "MM MTP <= CSendObject::ConstructL" ) );
   134     }
   133     }
   135 
   134 
   136 // -----------------------------------------------------------------------------
   135 // -----------------------------------------------------------------------------
   137 // CSendObject::Match
   136 // CSendObject::Match
  1033     {
  1032     {
  1034     PRINT1( _L("MM MTP => CSendObject::GetFullPathNameL aFileName = %S"), &aFileName );
  1033     PRINT1( _L("MM MTP => CSendObject::GetFullPathNameL aFileName = %S"), &aFileName );
  1035 
  1034 
  1036     TBool result( EFalse );
  1035     TBool result( EFalse );
  1037 
  1036 
       
  1037     TParsePtrC parser( aFileName );
  1038     if ( aFileName.Length() > 0 )
  1038     if ( aFileName.Length() > 0 )
  1039         {
  1039         {
  1040         iFullPath.Zero();
  1040         iFullPath.Zero();
  1041         iFullPath.Append( *iParentSuid );
  1041         iFullPath.Append( *iParentSuid );
  1042 
  1042 
  1043         // TODO: need to be done in derived class
  1043         // TODO: need to be done in derived class
  1044         // Only add extension for alb to pass winlogo test cases
  1044         // Only add extension for alb to pass winlogo test cases
  1045         TInt length = iFullPath.Length() + aFileName.Length();
  1045         TInt length = iFullPath.Length() + aFileName.Length();
  1046 
  1046 
  1047         TParsePtrC parser( aFileName );
       
  1048         TBool isAlbWithoutExt =
  1047         TBool isAlbWithoutExt =
  1049             ( ( iObjectFormat == EMTPFormatCodeAbstractAudioAlbum ) && ( !parser.ExtPresent() ) );
  1048             ( ( iObjectFormat == EMTPFormatCodeAbstractAudioAlbum ) && ( !parser.ExtPresent() ) );
  1050         if ( isAlbWithoutExt )
  1049         if ( isAlbWithoutExt )
  1051             length += KTxtExtensionALB().Length();
  1050             length += KTxtExtensionALB().Length();
  1052 
  1051 
  1060             }
  1059             }
  1061         }
  1060         }
  1062 
  1061 
  1063     if ( result && ( iObjectFormat != MmMtpDpUtility::FormatFromFilename( iFullPath ) ) )
  1062     if ( result && ( iObjectFormat != MmMtpDpUtility::FormatFromFilename( iFullPath ) ) )
  1064         {
  1063         {
  1065         TParsePtrC file( aFileName );
  1064         if ( ( iObjectFormat == EMTPFormatCode3GPContainer ) && ( parser.Ext().CompareF( KTxtExtensionODF ) == 0))
  1066         if ( ( iObjectFormat == EMTPFormatCode3GPContainer ) && (file.Ext().CompareF( KTxtExtensionODF ) == 0))
       
  1067             {
  1065             {
  1068             PRINT( _L( "MM MTP <> might happen if function is called before physical file arrives" ) );
  1066             PRINT( _L( "MM MTP <> might happen if function is called before physical file arrives" ) );
  1069             // might happen if function is called before physical file arrives
  1067             // might happen if function is called before physical file arrives
  1070             // do nothing
  1068             // do nothing
  1071             }
  1069             }
  1265         if ( err != KErrNone )
  1263         if ( err != KErrNone )
  1266             PRINT1( _L( "MM MTP <> CSendObject::SaveEmptyFileL err = %d" ), err );
  1264             PRINT1( _L( "MM MTP <> CSendObject::SaveEmptyFileL err = %d" ), err );
  1267         iDpConfig.GetWrapperL().AddDummyFileL( iFullPath );
  1265         iDpConfig.GetWrapperL().AddDummyFileL( iFullPath );
  1268         }
  1266         }
  1269 
  1267 
       
  1268     // Set subformat code to avoid MPX query for the first time to GetObjectReference,
       
  1269     // in which case references has been kept in fw.
       
  1270     if ( MmMtpDpUtility::HasReference( iObjectFormat ) )
       
  1271         iReceivedObjectInfo->SetUint( CMTPObjectMetaData::EFormatSubCode, EMTPSubFormatCodeUndefined );
       
  1272 
  1270     // add playlist to MPX DB
  1273     // add playlist to MPX DB
  1271     TRAPD( err, AddMediaToStoreL() );
  1274     TRAPD( err, AddMediaToStoreL() );
  1272 
  1275 
  1273     if ( err != KErrNone )
  1276     if ( err != KErrNone )
  1274         iRollbackList.Append( &CSendObject::RemoveObjectFromDbL );
  1277         iRollbackList.Append( &CSendObject::RemoveObjectFromDbL );