mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/ccopyobject.cpp
branchRCL_3
changeset 23 e42293e811d8
parent 18 e257e2b6459d
equal deleted inserted replaced
22:b034b1c214c2 23:e42293e811d8
   308     // Only leave when getting proplist element from data received by fw.
   308     // Only leave when getting proplist element from data received by fw.
   309     // It should not happen after ReceiveDataL in which construction of proplist already succeed.
   309     // It should not happen after ReceiveDataL in which construction of proplist already succeed.
   310     SetPreviousPropertiesL();
   310     SetPreviousPropertiesL();
   311 
   311 
   312     CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() );
   312     CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() );
       
   313     CleanupStack::PushL( fileMan ); // + fileMan
   313     User::LeaveIfError( fileMan->Copy( oldFileName, aNewFileName ) );
   314     User::LeaveIfError( fileMan->Copy( oldFileName, aNewFileName ) );
   314     delete fileMan;
   315     CleanupStack::PopAndDestroy( fileMan ); // - fileMan
   315     fileMan = NULL;
       
   316 
   316 
   317     PRINT( _L( "MM MTP <= CCopyObject::CopyFileL" ) );
   317     PRINT( _L( "MM MTP <= CCopyObject::CopyFileL" ) );
   318     return handle;
   318     return handle;
   319     }
   319     }
   320 
   320 
   414 // -----------------------------------------------------------------------------
   414 // -----------------------------------------------------------------------------
   415 //
   415 //
   416 void CCopyObject::SetPreviousPropertiesL()
   416 void CCopyObject::SetPreviousPropertiesL()
   417     {
   417     {
   418     PRINT( _L( "MM MTP => CCopyObject::SetPreviousPropertiesL" ) );
   418     PRINT( _L( "MM MTP => CCopyObject::SetPreviousPropertiesL" ) );
   419 
       
   420     TMTPResponseCode respcode = EMTPRespCodeOK;
       
   421 
   419 
   422     iPropertyList->ResetCursor();
   420     iPropertyList->ResetCursor();
   423     const TInt count = iPropertyList->NumberOfElements();
   421     const TInt count = iPropertyList->NumberOfElements();
   424     for ( TInt i = 0; i < count; i++ )
   422     for ( TInt i = 0; i < count; i++ )
   425         {
   423         {
   458             case EMTPObjectPropCodeName:
   456             case EMTPObjectPropCodeName:
   459             case EMTPObjectPropCodeAlbumArtist:
   457             case EMTPObjectPropCodeAlbumArtist:
   460                 {
   458                 {
   461                 CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData
   459                 CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData
   462 
   460 
   463                 respcode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
   461                 iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
   464                     propertyCode,
   462                     propertyCode,
   465                     *stringData,
   463                     *stringData,
   466                     *iTargetObject );
   464                     *iTargetObject );
   467 
   465 
   468                 CleanupStack::PopAndDestroy( stringData ); // - stringData
   466                 CleanupStack::PopAndDestroy( stringData ); // - stringData
   469                 }
   467                 }
   470                 break;
   468                 break;
   471 
   469 
   472             default:
   470             default:
   473                 {
   471                 {
   474                 respcode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig,
   472                 iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig,
   475                     propertyCode,
   473                     propertyCode,
   476                     *iTargetObject,
   474                     *iTargetObject,
   477                     element );
   475                     element );
   478                 }
   476                 }
   479                 break;
   477                 break;
   480             }
   478             }
   481         } // end of for loop
   479         } // end of for loop
   482 
   480 
   483     // ignore errors
   481     PRINT( _L( "MM MTP <= CCopyObject::SetPreviousPropertiesL" ) );
   484     if ( respcode == EMTPRespCodeOK )
       
   485         {
       
   486         // do nothing, just to get rid of build warning
       
   487         }
       
   488 
       
   489     PRINT1( _L( "MM MTP <= CCopyObject::SetPreviousPropertiesL respcode = 0x%x" ), respcode );
       
   490     }
   482     }
   491 
   483 
   492 // -----------------------------------------------------------------------------
   484 // -----------------------------------------------------------------------------
   493 // CCopyObject::UpdateObjectInfoL
   485 // CCopyObject::UpdateObjectInfoL
   494 // Update object info in the database
   486 // Update object info in the database