16 */ |
16 */ |
17 |
17 |
18 |
18 |
19 #include <mtp/cmtptypestring.h> |
19 #include <mtp/cmtptypestring.h> |
20 #include <mtp/cmtptypearray.h> |
20 #include <mtp/cmtptypearray.h> |
21 #include <mtp/mmtpdataproviderframework.h> |
|
22 #include <mtp/mmtpobjectmgr.h> |
21 #include <mtp/mmtpobjectmgr.h> |
23 #include <mtp/cmtpobjectmetadata.h> |
|
24 #include <f32file.h> |
22 #include <f32file.h> |
25 |
23 |
26 #include "cgetobjectpropvalue.h" |
24 #include "cgetobjectpropvalue.h" |
27 #include "mmmtpdputility.h" |
25 #include "mmmtpdputility.h" |
28 #include "cmmmtpdpmetadataaccesswrapper.h" |
26 #include "cmmmtpdpmetadataaccesswrapper.h" |
226 break; |
224 break; |
227 |
225 |
228 // Name and DataAdded (audio only) fall under the same branch while dateadded(video)/modified/created fall under another |
226 // Name and DataAdded (audio only) fall under the same branch while dateadded(video)/modified/created fall under another |
229 case EMTPObjectPropCodeName: // 0xDC44 |
227 case EMTPObjectPropCodeName: // 0xDC44 |
230 case EMTPObjectPropCodeDateAdded: // 0xDC4E |
228 case EMTPObjectPropCodeDateAdded: // 0xDC4E |
231 { |
229 case EMTPObjectPropCodeAlbumArtist: |
232 if ( ( propCode == EMTPObjectPropCodeName ) |
230 { |
233 || ( ( !MmMtpDpUtility::IsVideoL(iObjectInfo->DesC( CMTPObjectMetaData::ESuid ), iFramework ) ) |
231 iMTPTypeString = CMTPTypeString::NewL(); |
234 && ( propCode == EMTPObjectPropCodeDateAdded ) ) ) |
232 ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo ); |
235 { |
233 } |
236 iMTPTypeString = CMTPTypeString::NewL(); |
234 break; |
237 ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo ); |
|
238 break; |
|
239 } |
|
240 // Else, video DB does not support DateAdded field, use the file system date! |
|
241 // It's the same behavior with DateCreated and DateModified. |
|
242 // Fall through intentional. |
|
243 } |
|
244 //lint -fallthrough |
235 //lint -fallthrough |
245 case EMTPObjectPropCodeDateCreated: |
236 case EMTPObjectPropCodeDateCreated: |
246 case EMTPObjectPropCodeDateModified: |
237 case EMTPObjectPropCodeDateModified: |
247 { |
238 { |
248 TTime dataModified; |
|
249 dataModified = MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(), |
|
250 iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) ); |
|
251 |
|
252 TBuf<KMtpMaxDateTimeStringLength> timeStr; |
239 TBuf<KMtpMaxDateTimeStringLength> timeStr; |
253 dataModified.FormatL( timeStr, KMtpDateTimeFormat ); |
240 MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(), |
|
241 iObjectInfo->DesC( CMTPObjectMetaData::ESuid ), |
|
242 timeStr ); |
|
243 |
254 PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL Date time %S" ), &timeStr ); |
244 PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL Date time %S" ), &timeStr ); |
255 iMTPTypeString = CMTPTypeString::NewL( timeStr ); |
245 iMTPTypeString = CMTPTypeString::NewL( timeStr ); |
256 SendDataL( *iMTPTypeString ); |
246 SendDataL( *iMTPTypeString ); |
257 } |
247 } |
258 break; |
248 break; |