phoneengine/servicehandling/src/cpeservicehandling.cpp
changeset 22 6bb1b21d2484
parent 21 92ab7f8d0eab
child 51 f39ed5e045e0
--- a/phoneengine/servicehandling/src/cpeservicehandling.cpp	Fri Mar 19 09:28:42 2010 +0200
+++ b/phoneengine/servicehandling/src/cpeservicehandling.cpp	Fri Apr 16 14:58:25 2010 +0300
@@ -20,8 +20,8 @@
 #include <mpedatastore.h>
 #include <pevirtualengine.h>
 #include <e32debug.h>
-#include <talogger.h>
 
+#include "talogger.h"
 #include "cpeservicehandling.h"
 
 // ======== MEMBER FUNCTIONS ========
@@ -75,12 +75,8 @@
 EXPORT_C CPEServiceHandling::~CPEServiceHandling()
     {
     TEFLOGSTRING( KTAOBJECT, "PE CPEServiceHandling::~CPEServiceHandling" );
-    // <-- QT PHONE START -->
-    // delete iCchClient;
-    // <-- QT PHONE END -->
     }
 
-// <-- QT PHONE START -->
 // ---------------------------------------------------------------------------
 // CPEServiceHandling::EnableService
 // ---------------------------------------------------------------------------
@@ -88,173 +84,9 @@
 void CPEServiceHandling::EnableServiceL( TInt /*aServiceId*/ )
     {
     TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::EnableServiceL" );
-        
-    /*if ( !iCchClient )
-        {
-        iCchClient = CCch::NewL();
-        }
-
-    CCchService* service = iCchClient->GetService( aServiceId );
-    
-    TInt error( KErrNotFound );
-    if( service )
-        {
-        iCurrentServiceId = aServiceId;
-        
-        TCchServiceStatus serviceStatus;
-        error = service->GetStatus( ECCHVoIPSub, serviceStatus );
-        TCCHSubserviceState state = serviceStatus.State();
-    
-        if( error == KErrNone )
-            {
-            if ( serviceStatus.Error() == KErrNone )
-                {
-                error = EnableServiceIfNeeded( state, *service );
-                }
-            else
-                {
-                TEFLOGSTRING2( KTAERROR,
-                        "PE CPEServiceHandling::EnableServiceL, error: %d"
-                        , serviceStatus.Error() );
-                SendErrorMessage( serviceStatus.Error());
-                }
-            }
-        }
-    
-    if ( error != KErrNone )
-        {
-        if ( error == KErrNotFound )
-             {
-             iModel.SendMessage( MEngineMonitor::EPEMessageNoService );
-             }
-         else
-             {
-             TEFLOGSTRING2( KTAERROR,
-                      "PE CPEServiceHandling::EnableServiceL, Error: %d"
-                      , error );
-             SendErrorMessage( error );
-             }
-        }
-    
-    TEFLOGSTRING2( KTAINT, 
-            "PE CPEServiceHandling::EnableServiceL, error: %d", error );*/
-
     User::LeaveIfError( 0 );
     iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabled );
-    
-    // <-- QT PHONE END -->
     }
-
-// <-- QT PHONE START -->
-// ---------------------------------------------------------------------------
-// CPEServiceHandling::EnableServiceIfNeeded
-// ---------------------------------------------------------------------------
-//
-/*TInt CPEServiceHandling::EnableServiceIfNeeded( 
-        const TCCHSubserviceState& aState, 
-        CCchService& aService )
-    {
-    TEFLOGSTRING( KTAINT, "PE CPEServiceHandling::EnableServiceIfNeeded" );
-    TInt error = KErrNone;
-    
-    TEFLOGSTRING2( KTAINT, 
-            "PE CPEServiceHandling::EnableServiceIfNeeded, aState: %d", aState );
-    switch ( aState )
-        {
-        case ECCHEnabled:
-            {
-            iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabled );
-            }
-            break;
-        case ECCHUninitialized:
-        case ECCHDisabled:
-        case ECCHConnecting:
-            {
-            // Temporary solution, it will be fixed as soon as possible. 
-            // Message have to send before enable is called. Reason is so that progress bar 
-            //(global note) doesn't hide Networks's "Connection Needed" global note.
-            iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabling );
-            aService.AddObserver( *this );
-            error = aService.Enable( ECCHUnknown );  
-            }
-            break;
-        case ECCHDisconnecting:
-            {
-            error = KErrNotFound;
-            }
-            break;
-        default:
-            break;
-        }
-    TEFLOGSTRING2( KTAINT, 
-            "PE CPEServiceHandling::EnableServiceIfNeeded, error: %d", error );
-    return error;
-    }
-    
-// ---------------------------------------------------------------------------
-// CPEServiceHandling::ServiceStatusChanged
-// ---------------------------------------------------------------------------
-//
-void CPEServiceHandling::ServiceStatusChanged(
-    TInt aServiceId,
-    const TCCHSubserviceType aType,
-    const TCchServiceStatus& aServiceStatus )
-    {
-    TEFLOGSTRING( KTAINT, "PE CPEServiceHandling::ServiceStatusChanged <" );
-    
-    if( aServiceId == iCurrentServiceId && aType == ECCHVoIPSub )
-        {
-        TEFLOGSTRING3( KTAINT,
-                "PE CPEServiceHandling::ServiceStatusChanged, state: %d, error: %d"
-                , aServiceStatus.State()
-                , aServiceStatus.Error() );
-
-        CCchService* service = iCchClient->GetService( aServiceId );
-        if( service )
-            {
-            if( aServiceStatus.Error() != KErrNone )
-                {
-                TEFLOGSTRING( KTAERROR, 
-                        "PE CPEServiceHandling::ServiceStatusChanged, error" );
-                SendErrorMessage( aServiceStatus.Error());
-                CancelServiceEnabling();
-                }
-            else 
-                {
-                if( aServiceStatus.State() == ECCHEnabled )
-                    {
-                    TEFLOGSTRING( KTAINT, 
-                             "PE CPEServiceHandling::ServiceStatusChanged, enabled" );
-                    iModel.SendMessage( MEngineMonitor::EPEMessageServiceEnabled );
-                    }
-
-
-                // Notify UI, that service is disabled.
-                else if( aServiceStatus.State() == ECCHDisabled ) 
-                     {
-                     TEFLOGSTRING( KTAERROR, 
-                              "PE CPEServiceHandling::ServiceStatusChanged, disabled" );
-                     iModel.SendMessage( MEngineMonitor::EPEMessageServiceDisabled );
-                     }
-                }
-            
-            // don't remove observer, if state are connecting or disconnecting
-            if ( aServiceStatus.State() != ECCHConnecting && 
-                 aServiceStatus.State() != ECCHDisconnecting )
-                {
-                service->RemoveObserver( *this );
-                }
-            }//if( service )
-        else
-            {
-            TEFLOGSTRING( KTAERROR, 
-                    "PE CPEServiceHandling::ServiceStatusChanged, no service" );
-            }
-        }
-    TEFLOGSTRING( KTAINT, "PE CPEServiceHandling::ServiceStatusChanged >" );
-    }*/
-
-
     
 // ---------------------------------------------------------------------------
 // CPEServiceHandling::CancelServiceEnabling
@@ -263,61 +95,15 @@
 void CPEServiceHandling::CancelServiceEnabling() const
     {
     TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::CancelServiceEnabling" );
-    
-    /*if ( iCchClient )
-        {
-        CCchService* service = iCchClient->GetService( iCurrentServiceId );
-        
-        if ( service )
-            {
-            TCchServiceStatus serviceStatus;
-            TInt error = service->GetStatus( ECCHVoIPSub, serviceStatus );
-            TCCHSubserviceState state = serviceStatus.State();
-            
-            // Disable only, if service is connecting state
-            if ( error == KErrNone && state == ECCHConnecting )
-                {
-                TEFLOGSTRING( KTAREQOUT,
-                  "PE CPEServiceHandling::CancelServiceEnabling, CCchService->Disable" );
-                service->Disable( ECCHUnknown );
-                }
-            }
-        }*/
     }
         
 // -----------------------------------------------------------------------------
-// CPEServiceHandling::SendErrorMessage
-// -----------------------------------------------------------------------------
-//
-/*void CPEServiceHandling::SendErrorMessage(
-        TInt aErrorCode )
-    {
-    TEFLOGSTRING2( KTAINT, 
-        "PE CPEServiceHandling::SendErrorMessage, aErrorCode: %d", 
-        aErrorCode );
-
-    iModel.DataStore()->SetErrorCode( aErrorCode );
-    iModel.SendMessage( MEngineMonitor::EPEMessageServiceHandlingError );
-    }*/
-
-// -----------------------------------------------------------------------------
 // CPEServiceHandling::DisableService
 // -----------------------------------------------------------------------------
 //
 void CPEServiceHandling::DisableService() const
     {
     TEFLOGSTRING( KTAREQIN, "PE CPEServiceHandling::DisableService" );
-
-    /*CCchService* service = iCchClient->GetService( iCurrentServiceId );
-    
-    if ( service )
-        {
-        TEFLOGSTRING( KTAREQOUT,
-          "PE CPEServiceHandling::DisableService, CCchService->Disable" );
-        service->Disable( ECCHUnknown );
-        }*/
     } 
 
-// <-- QT PHONE END -->
-
 //  End of File