mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp
changeset 25 d881023c13eb
parent 0 a2952bb97e68
child 32 edd273b3192a
--- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp	Fri Apr 16 15:28:14 2010 +0300
+++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/src/cgetobjectpropvalue.cpp	Mon May 03 12:58:40 2010 +0300
@@ -18,9 +18,7 @@
 
 #include <mtp/cmtptypestring.h>
 #include <mtp/cmtptypearray.h>
-#include <mtp/mmtpdataproviderframework.h>
 #include <mtp/mmtpobjectmgr.h>
-#include <mtp/cmtpobjectmetadata.h>
 #include <f32file.h>
 
 #include "cgetobjectpropvalue.h"
@@ -28,9 +26,8 @@
 #include "cmmmtpdpmetadataaccesswrapper.h"
 #include "mmmtpdplogger.h"
 #include "mmmtpdpconfig.h"
+#include "tobjectdescription.h"
 
-_LIT( KMtpDateTimeFormat, "%F%Y%M%DT%H%T%S" );
-const TInt KMtpMaxDateTimeStringLength = 15;
 
 // -----------------------------------------------------------------------------
 // Verification data for the GetObjectPropValue request
@@ -138,7 +135,7 @@
     TUint32 objectHandle = Request().Uint32( TMTPTypeRequest::ERequestParameter1 );
     TUint32 propCode = Request().Uint32( TMTPTypeRequest::ERequestParameter2 );
     PRINT2( _L( "MM MTP <> CGetObjectPropValue::ServiceL objectHandle = 0x%x, propCode = 0x%x" ),
-            objectHandle, propCode );
+        objectHandle, propCode );
 
     // don't have the ownship of the object
     iObjectInfo = iRequestChecker->GetObjectInfo( objectHandle );
@@ -146,8 +143,6 @@
     PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL object file name is %S" ), &suid );
     TParsePtrC parse( suid );
 
-    iDpConfig.GetWrapperL().SetStorageRootL( parse.Drive() );
-
     if ( iMTPTypeString != NULL )
         {
         delete iMTPTypeString;
@@ -182,7 +177,7 @@
             {
             iMTPTypeUint16.Set( 0 );
             iMTPTypeUint16 = MmMtpDpUtility::GetProtectionStatusL( iFramework.Fs(),
-                    iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
+                iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
             SendDataL( iMTPTypeUint16 );
             }
             break;
@@ -231,26 +226,21 @@
         // Name and DataAdded (audio only) fall under the same branch while dateadded(video)/modified/created fall under another
         case EMTPObjectPropCodeName: // 0xDC44
         case EMTPObjectPropCodeDateAdded: // 0xDC4E
+        case EMTPObjectPropCodeAlbumArtist:
             {
-            if ( ( propCode == EMTPObjectPropCodeName)
-                || ( ( !MmMtpDpUtility::IsVideoL(iObjectInfo->DesC( CMTPObjectMetaData::ESuid ), iFramework ) )
-                        && ( propCode == EMTPObjectPropCodeDateAdded ) ) )
-                {
-                iMTPTypeString = CMTPTypeString::NewL();
-                ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo );
-                break;
-                }
+            iMTPTypeString = CMTPTypeString::NewL();
+            ServiceMetaDataFromWrapperL( propCode, *iMTPTypeString, *iObjectInfo );
             }
+            break;
         //lint -fallthrough
         case EMTPObjectPropCodeDateCreated:
         case EMTPObjectPropCodeDateModified:
             {
-            TTime dataModified;
-            dataModified = MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(),
-                iObjectInfo->DesC( CMTPObjectMetaData::ESuid ) );
+            TBuf<KMtpMaxDateTimeStringLength> timeStr;
+            MmMtpDpUtility::GetObjectDateModifiedL( iFramework.Fs(),
+                iObjectInfo->DesC( CMTPObjectMetaData::ESuid ),
+                timeStr );
 
-            TBuf<KMtpMaxDateTimeStringLength> timeStr;
-            dataModified.FormatL( timeStr, KMtpDateTimeFormat );
             PRINT1( _L( "MM MTP <> CGetObjectPropValue::ServiceL Date time %S" ), &timeStr );
             iMTPTypeString = CMTPTypeString::NewL( timeStr );
             SendDataL( *iMTPTypeString );
@@ -260,7 +250,7 @@
         // Consumable
         case EMTPObjectPropCodeNonConsumable:
             {
-            iMTPTypeUint8.Set( 0 );
+            iMTPTypeUint8.Set( iObjectInfo->Uint( CMTPObjectMetaData::ENonConsumable ) );
             SendDataL( iMTPTypeUint8 );
             }
             break;