equal
deleted
inserted
replaced
16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <mtp/mmtpdataproviderframework.h> |
19 #include <mtp/mmtpdataproviderframework.h> |
20 #include <mtp/mmtpobjectmgr.h> |
20 #include <mtp/mmtpobjectmgr.h> |
|
21 #include <mtp/mmtpreferencemgr.h> |
21 #include <mtp/cmtpobjectmetadata.h> |
22 #include <mtp/cmtpobjectmetadata.h> |
22 |
23 |
23 #include "cdeleteobject.h" |
24 #include "cdeleteobject.h" |
24 #include "mmmtpdplogger.h" |
25 #include "mmmtpdplogger.h" |
25 #include "mmmtpdpconfig.h" |
26 #include "mmmtpdpconfig.h" |
26 #include "cmmmtpdpmetadataaccesswrapper.h" |
27 #include "cmmmtpdpmetadataaccesswrapper.h" |
|
28 #include "mmmtpdputility.h" |
27 |
29 |
28 // static const TInt KMTPDriveGranularity = 5; |
30 // static const TInt KMTPDriveGranularity = 5; |
29 |
31 |
30 // ----------------------------------------------------------------------------- |
32 // ----------------------------------------------------------------------------- |
31 // Verification data for the DeleteObject request |
33 // Verification data for the DeleteObject request |
89 aConnection, |
91 aConnection, |
90 sizeof( KMTPDeleteObjectPolicy ) / sizeof( TMTPRequestElementInfo ), |
92 sizeof( KMTPDeleteObjectPolicy ) / sizeof( TMTPRequestElementInfo ), |
91 KMTPDeleteObjectPolicy ), |
93 KMTPDeleteObjectPolicy ), |
92 iObjectMgr( aFramework.ObjectMgr() ), |
94 iObjectMgr( aFramework.ObjectMgr() ), |
93 iFs( aFramework.Fs() ), |
95 iFs( aFramework.Fs() ), |
94 iObjectsToDelete( KMmMtpRArrayGranularity ), |
96 iObjectsToDelete( KMmMtpRArrayGranularity ), |
95 iDeleteError( KErrNone ), |
97 iDeleteError( KErrNone ), |
96 iDpConfig( aDpConfig ) |
98 iDpConfig( aDpConfig ) |
97 { |
99 { |
98 PRINT( _L( "Operation: DeleteObject(0x100B)" ) ); |
100 PRINT( _L( "Operation: DeleteObject(0x100B)" ) ); |
99 } |
101 } |
261 TRAP( iDeleteError, iDpConfig.GetWrapperL().DeleteObjectL( fileName, aObjectInfo.Uint( CMTPObjectMetaData::EFormatCode ) )); |
263 TRAP( iDeleteError, iDpConfig.GetWrapperL().DeleteObjectL( fileName, aObjectInfo.Uint( CMTPObjectMetaData::EFormatCode ) )); |
262 PRINT1( _L( "MM MTP <> CDeleteObject::DeleteObjectL, Delete from Media DB, err = %d" ), iDeleteError ); |
264 PRINT1( _L( "MM MTP <> CDeleteObject::DeleteObjectL, Delete from Media DB, err = %d" ), iDeleteError ); |
263 |
265 |
264 // 3. Delete object from framework db |
266 // 3. Delete object from framework db |
265 iObjectMgr.RemoveObjectL( aObjectInfo.Uint( CMTPObjectMetaData::EHandle ) ); |
267 iObjectMgr.RemoveObjectL( aObjectInfo.Uint( CMTPObjectMetaData::EHandle ) ); |
|
268 |
|
269 // 4. If the object has references, Delete references from reference manager |
|
270 if ( MmMtpDpUtility::HasReference( aObjectInfo.Uint( CMTPObjectMetaData::EFormatCode ) ) ) |
|
271 iFramework.ReferenceMgr().RemoveReferencesL( aObjectInfo.DesC( CMTPObjectMetaData::ESuid ) ); |
266 |
272 |
267 PRINT( _L( "MM MTP <= CDeleteObject::DeleteObjectL" ) ); |
273 PRINT( _L( "MM MTP <= CDeleteObject::DeleteObjectL" ) ); |
268 } |
274 } |
269 |
275 |
270 // ----------------------------------------------------------------------------- |
276 // ----------------------------------------------------------------------------- |