cmmanager/cmmgr/cmmapi/src/cmconnectionmethod.cpp
changeset 27 489cf6208544
parent 20 9c97ad6591ae
--- a/cmmanager/cmmgr/cmmapi/src/cmconnectionmethod.cpp	Fri May 14 16:15:46 2010 +0300
+++ b/cmmanager/cmmgr/cmmapi/src/cmconnectionmethod.cpp	Thu May 27 13:17:01 2010 +0300
@@ -178,7 +178,6 @@
     else
         {
         CleanupStack::PopAndDestroy( buffer );
-        buffer = NULL;
         buffer = KNullDesC().AllocL();
         }
 
@@ -211,7 +210,6 @@
     else
         {
         CleanupStack::PopAndDestroy( buffer8 );
-        buffer8 = NULL;
         buffer8 = KNullDesC8().AllocL();
         }
 
@@ -495,21 +493,44 @@
     {
     OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_GETICONL_ENTRY );
 
-    User::Leave( KErrNotSupported );
+    if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() )
+        {
+        User::Leave( KErrBadHandle );
+        }
+
+    HBufC* buffer = HBufC::NewLC( KCmmStringLengthMax );
+    TInt err = iCmConnectionMethodWrapper->GetStringAttribute( CMManager::ECmBearerIcon, buffer );
+    User::LeaveIfError( err );
+
+    if ( buffer->Length() > 0 )
+        {
+        CleanupStack::Pop( buffer );
+        }
+    else
+        {
+        CleanupStack::PopAndDestroy( buffer );
+        buffer = KNullDesC().AllocL();
+        }
 
     OstTraceFunctionExit0( RCMCONNECTIONMETHOD_GETICONL_EXIT );
-    return NULL;
+    return buffer;
     }
 
 //-----------------------------------------------------------------------------
 //  RCmConnectionMethod::SetIconL()
 //-----------------------------------------------------------------------------
 //
-EXPORT_C void RCmConnectionMethod::SetIconL( const TDesC& /*aIcon*/ )
+EXPORT_C void RCmConnectionMethod::SetIconL( const TDesC& aIcon )
     {
     OstTraceFunctionEntry0( RCMCONNECTIONMETHOD_SETICONL_ENTRY );
 
-    User::Leave( KErrNotSupported );
+    if ( !iCmConnectionMethodWrapper || !iCmConnectionMethodWrapper->SessionConnected() )
+        {
+        User::Leave( KErrBadHandle );
+        }
+
+    TInt err = iCmConnectionMethodWrapper->SetStringAttribute( CMManager::ECmBearerIcon, aIcon );
+    User::LeaveIfError( err );
 
     OstTraceFunctionExit0( RCMCONNECTIONMETHOD_SETICONL_EXIT );
     }