simpleengine/engine/src/simpleconnection.cpp
branchRCL_3
changeset 35 fbd2e7cec7ef
parent 34 2669f8761a99
--- a/simpleengine/engine/src/simpleconnection.cpp	Tue Aug 31 15:35:50 2010 +0300
+++ b/simpleengine/engine/src/simpleconnection.cpp	Wed Sep 01 12:23:14 2010 +0100
@@ -65,7 +65,7 @@
 // CSimpleConnection::ConstructL
 // ----------------------------------------------------------
 //
-void CSimpleConnection::ConstructL()
+void CSimpleConnection::ConstructL( TInt32 aServiceId )
     {
     // Create CSimpleSipConnection entity in simplesiputils.dll
     iConnection = CSimpleSipConnection::NewL();
@@ -79,6 +79,10 @@
     CSimpleEngineRequest* req = CSimpleEngineRequest::NewL(
         *this, MSimpleEngineRequest::EListenEvents, iOpId );
     CleanupStack::PushL( req );
+    if ( aServiceId )
+        {
+        iConnection->SetServiceId( aServiceId );
+        }
     iConnection->DispatchReqL( *req );
     iRequestList.AddLast( *req );
     CleanupStack::Pop( req );
@@ -96,7 +100,24 @@
 #endif
     CSimpleConnection* self = new (ELeave) CSimpleConnection( aObserver );
     CleanupStack::PushL( self );
-    self->ConstructL();
+    self->ConstructL( NULL );
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+// ----------------------------------------------------------
+// CSimpleConnection::NewL
+// ----------------------------------------------------------
+//
+CSimpleConnection* CSimpleConnection::NewL(
+    MSimpleConnectionObserver& aObserver, TInt32 aServiceId )
+    {
+#ifdef _DEBUG
+    TSimpleLogger::Log(_L("SimpleConnection: NewL" ));
+#endif
+    CSimpleConnection* self = new (ELeave) CSimpleConnection( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL( aServiceId );
     CleanupStack::Pop( self );
     return self;
     }