services/terminalmodeservice/src/upnptmclientprofileservice.cpp
changeset 26 b6b8e90f9863
parent 24 e9457ebcc4df
--- a/services/terminalmodeservice/src/upnptmclientprofileservice.cpp	Fri Jul 23 08:57:49 2010 +0300
+++ b/services/terminalmodeservice/src/upnptmclientprofileservice.cpp	Fri Aug 06 18:27:32 2010 +0300
@@ -178,12 +178,12 @@
     {
     OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL_ENTRY );
     TUint profileIdInt;
-    // Validates the input parameter(profileID)
-    if ( ConvertDescriptorToInt( aAction->ArgumentValue(KProfileId), profileIdInt ) != KErrNone )
-         {
-         OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::SetClientProfileActionL;profileIdInt=%d", profileIdInt );      
-         return EInvalidArgs;   // invalid profile ID
-         }  
+    // Fetch the value for profile ID argument
+    TLex8 lex( aAction->ArgumentValue(KProfileId) );
+    lex.Val(profileIdInt);
+    OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_SETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::SetClientProfileActionL;profileIdInt=%d", profileIdInt );      
+    
+    // Fetch the value for client profile argument
     const TDesC8& clientProfile = aAction->ArgumentValue(KClientProfile);
     
     RBuf8 resultProfileBuf;
@@ -211,13 +211,11 @@
     { 
     OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_GETCLIENTPROFILEACTIONL_ENTRY );
     TUint profileIdInt;
-    // Validates the input parameter(profileID)
-    if ( ConvertDescriptorToInt( aAction->ArgumentValue(KProfileId), profileIdInt ) != KErrNone )
-         {
-         OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_GETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::GetClientProfileActionL;profileIdInt=%d", profileIdInt );        
-         return EInvalidArgs;   // invalid profile ID
-         }
-    
+    // Fetch the value for profile ID argument
+    TLex8 lex( aAction->ArgumentValue(KProfileId) );
+    lex.Val(profileIdInt);
+    OstTrace1( TRACE_ERROR, CUPNPTMCLIENTPROFILESERVICE_GETCLIENTPROFILEACTIONL, "CUpnpTmClientProfileService::GetClientProfileActionL;profileIdInt=%d", profileIdInt );        
+
     RBuf8 resultProfileBuf;
     TTerminalModeErrorCode ret = iTmServerImpl.GetClientProfile(profileIdInt,resultProfileBuf );
     
@@ -247,22 +245,4 @@
     OstTraceFunctionExit0( CUPNPTMCLIENTPROFILESERVICE_UNUSEDPROFILEIDEVENTL_EXIT );
     }
 
-// ---------------------------------------------------------------------------------
-// CUpnpTmClientProfileService::ConvertDescriptorToInt
-// Utility method to convert descriptor to integer
-// @param aDes descriptor
-// @param[out] aIntVal Integer value
-// @return Returns error code
-// ---------------------------------------------------------------------------------
-//
-TInt CUpnpTmClientProfileService::ConvertDescriptorToInt( const TDesC8& aDes, TUint& aIntVal )
-    {
-    OstTraceFunctionEntry0( CUPNPTMCLIENTPROFILESERVICE_CONVERTDESCRIPTORTOINT_ENTRY );
-    aIntVal = KErrNone;
-    TLex8 lex( aDes );
-    OstTrace1( TRACE_NORMAL, CUPNPTMCLIENTPROFILESERVICE_CONVERTDESCRIPTORTOINT, "CUpnpTmClientProfileService::ConvertDescriptorToInt;aIntVal=%u", aIntVal );
-    OstTraceFunctionExit0( CUPNPTMCLIENTPROFILESERVICE_CONVERTDESCRIPTORTOINT_EXIT );
-    return lex.Val(aIntVal);  
-    }
-
 //End of File