mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cmoveobject.cpp
branchRCL_3
changeset 67 16db3449d7ba
parent 56 63223d4fd956
equal deleted inserted replaced
63:91d5ad76f5c6 67:16db3449d7ba
   290         iSameStorage = EFalse;
   290         iSameStorage = EFalse;
   291 
   291 
   292     // Move the file first no matter if it will fail in Get/SetPreviousPropertiesL
   292     // Move the file first no matter if it will fail in Get/SetPreviousPropertiesL
   293     // Already trapped inside
   293     // Already trapped inside
   294     GetPreviousPropertiesL( *iObjectInfo );
   294     GetPreviousPropertiesL( *iObjectInfo );
   295     TRAP_IGNORE( SetPropertiesL( aNewFileName ) );
   295     TRAPD( err, SetPropertiesL( aNewFileName ) );
   296 
   296 
   297     CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() );
   297     CFileMan* fileMan = CFileMan::NewL( iFramework.Fs() );
   298     CleanupStack::PushL( fileMan ); // + fileMan
   298     err = fileMan->Move( *oldFileName, aNewFileName );
   299     TInt err = fileMan->Move( *oldFileName, aNewFileName );
   299 	
   300     PRINT1( _L( "MM MTP <> CMoveObject::MoveFileL err = %d" ), err );
   300 	CleanupStack::PopAndDestroy( oldFileName );     // - oldFileName
   301     User::LeaveIfError( err );
   301 
   302     CleanupStack::PopAndDestroy( fileMan ); // - fileMan
   302     if ( err != KErrNone )
   303     CleanupStack::PopAndDestroy( oldFileName );     // - oldFileName
   303         PRINT1( _L( "MM MTP <> CMoveObject::MoveFileL err = %d" ), err );
   304 
   304 
   305     PRINT( _L( "MM MTP <= CMoveObject::MoveFileL" ) );
   305     PRINT( _L( "MM MTP <= CMoveObject::MoveFileL" ) );
   306     }
   306     }
   307 
   307 
   308 // -----------------------------------------------------------------------------
   308 // -----------------------------------------------------------------------------
   405 // -----------------------------------------------------------------------------
   405 // -----------------------------------------------------------------------------
   406 //
   406 //
   407 void CMoveObject::SetPreviousPropertiesL()
   407 void CMoveObject::SetPreviousPropertiesL()
   408     {
   408     {
   409     PRINT( _L( "MM MTP => CMoveObject::SetPreviousPropertiesL" ) );
   409     PRINT( _L( "MM MTP => CMoveObject::SetPreviousPropertiesL" ) );
       
   410 
       
   411     TMTPResponseCode respcode = EMTPRespCodeOK;
   410 
   412 
   411     iPropertyList->ResetCursor();
   413     iPropertyList->ResetCursor();
   412     const TInt count = iPropertyList->NumberOfElements();
   414     const TInt count = iPropertyList->NumberOfElements();
   413     for ( TInt i = 0; i < count; i++ )
   415     for ( TInt i = 0; i < count; i++ )
   414         {
   416         {
   445             case EMTPObjectPropCodeName:
   447             case EMTPObjectPropCodeName:
   446             case EMTPObjectPropCodeAlbumArtist:
   448             case EMTPObjectPropCodeAlbumArtist:
   447                 {
   449                 {
   448                 CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData
   450                 CMTPTypeString *stringData = CMTPTypeString::NewLC( element.StringL( CMTPTypeObjectPropListElement::EValue ) ); // + stringData
   449 
   451 
   450                 iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
   452                 respcode = iDpConfig.PropSettingUtility()->SetMetaDataToWrapper( iDpConfig,
   451                     propertyCode,
   453                     propertyCode,
   452                     *stringData,
   454                     *stringData,
   453                     *iObjectInfo );
   455                     *iObjectInfo );
   454 
   456 
   455                 CleanupStack::PopAndDestroy( stringData ); // - stringData
   457                 CleanupStack::PopAndDestroy( stringData ); // - stringData
   456                 }
   458                 }
   457                 break;
   459                 break;
   458 
   460 
   459             default:
   461             default:
   460                 {
   462                 {
   461                 iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig,
   463                 respcode = iDpConfig.PropSettingUtility()->SetSpecificObjectPropertyL( iDpConfig,
   462                     propertyCode,
   464                     propertyCode,
   463                     *iObjectInfo,
   465                     *iObjectInfo,
   464                     element );
   466                     element );
   465                 }
   467                 }
   466                 break;
   468                 break;
   467             }
   469             }
   468         } // end of for loop
   470         } // end of for loop
   469 
   471 
   470     PRINT( _L( "MM MTP <= CMoveObject::SetPreviousPropertiesL" ) );
   472     // ignore errors
       
   473     if ( respcode == EMTPRespCodeOK )
       
   474         {
       
   475         // do nothing, just to get rid of build warning
       
   476         }
       
   477 
       
   478     PRINT1( _L( "MM MTP <= CMoveObject::SetPreviousPropertiesL respcode = 0x%x" ), respcode );
   471     }
   479     }
   472 
   480 
   473 // -----------------------------------------------------------------------------
   481 // -----------------------------------------------------------------------------
   474 // CMoveObject::SetPropertiesL
   482 // CMoveObject::SetPropertiesL
   475 // Set the object properties in the object property store.
   483 // Set the object properties in the object property store.