mtpfws/mtpfw/dataproviders/dputility/src/cmtpgetobjectpropvalue.cpp
changeset 47 63cf70d3ecd8
parent 17 aabe5387f5ce
--- a/mtpfws/mtpfw/dataproviders/dputility/src/cmtpgetobjectpropvalue.cpp	Thu Sep 02 21:21:26 2010 +0300
+++ b/mtpfws/mtpfw/dataproviders/dputility/src/cmtpgetobjectpropvalue.cpp	Fri Sep 17 08:34:51 2010 +0300
@@ -27,6 +27,12 @@
 #include "cmtpgetobjectpropvalue.h"
 #include "mtpdpconst.h"
 #include "mtpdppanic.h"
+#include "mtpdebug.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "cmtpgetobjectpropvalueTraces.h"
+#endif
+
 
 
 /**
@@ -124,8 +130,10 @@
 	
 	TUint32 handle = Request().Uint32(TMTPTypeRequest::ERequestParameter1);
 	iFramework.ObjectMgr().ObjectL(TMTPTypeUint32(handle), *iObjMeta);
-	User::LeaveIfError(iRfs.Entry(iObjMeta->DesC(CMTPObjectMetaData::ESuid), iFileEntry));
-	
+	LEAVEIFERROR(iRfs.Entry(iObjMeta->DesC(CMTPObjectMetaData::ESuid), iFileEntry),
+	        OstTraceExt1(TRACE_ERROR, CMTPGETOBJECTPROPVALUE_SERVICEL, 
+	                "can't get entry details for %S!", iObjMeta->DesC(CMTPObjectMetaData::ESuid)));
+
 	TUint32 propCode = Request().Uint32(TMTPTypeRequest::ERequestParameter2);
 	switch(propCode)
 		{
@@ -165,7 +173,11 @@
 		case EMTPObjectPropCodeNonConsumable:
 			ServiceNonConsumableL();
 			break;
+		case EMTPObjectPropCodeHidden:
+		    ServiceHiddenL();
+		    break;
 		default:
+		    OstTrace1(TRACE_ERROR, DUP1_CMTPGETOBJECTPROPVALUE_SERVICEL, "Invalid property code %d", propCode );
 		    User::Leave( KErrNotSupported );
 			break;
 		}	
@@ -265,6 +277,19 @@
 	SendDataL(iMTPTypeUint8);
 	}
 
+void CMTPGetObjectPropValue::ServiceHiddenL()
+    {
+    TBool isHidden = iFileEntry.IsHidden();
+    if ( isHidden )
+        {
+        iMTPTypeUint16.Set(EMTPHidden);
+        }
+    else
+        {
+        iMTPTypeUint16.Set(EMTPVisible);
+        } 
+    SendDataL(iMTPTypeUint16);
+    }