phoneapp/phoneuistates/src/cphonesinglecall.cpp
changeset 78 baacf668fe89
parent 76 cfea66083b62
--- a/phoneapp/phoneuistates/src/cphonesinglecall.cpp	Mon Oct 04 16:06:10 2010 +0300
+++ b/phoneapp/phoneuistates/src/cphonesinglecall.cpp	Fri Oct 15 12:58:46 2010 +0300
@@ -41,13 +41,13 @@
 #include "phonerssbase.h"
 #include "phonestatedefinitionsgsm.h"
 #include "tphonecmdparamglobalnote.h"
-#include "tphonecmdparamcallstatedata.h"
 #include "phonelogger.h"
 #include "cphonepubsubproxy.h"
 #include "cphonemediatorfactory.h"
 #include "cphonemediatorsender.h"
 #include "mphonestorage.h"
 #include "cphonecenrepproxy.h"
+#include "phonecallutil.h"
 
 // ================= MEMBER FUNCTIONS =======================
 
@@ -83,28 +83,19 @@
     iViewCommandHandle->ExecuteCommandL( EPhoneViewSetGlobalNotifiersDisabled,
         &globalNotifierParam );
     
-    TPhoneCmdParamCallStateData callStateData;
-    callStateData.SetCallState( EPEStateConnected );
-    iViewCommandHandle->HandleCommandL(
-        EPhoneViewGetCallIdByState, &callStateData );
-    
+    TInt callId = PhoneCallUtil::CallIdByState( EPEStateConnected );
     // No connected call, 
-    if( callStateData.CallId() == KErrNotFound )
+    if( callId == KErrNotFound )
         {
         //find the held call.
-        callStateData.SetCallState( EPEStateHeld );
-        iViewCommandHandle->HandleCommandL(
-            EPhoneViewGetCallIdByState, &callStateData );
-        // No held call.
-        if ( callStateData.CallId() == KErrNotFound ) 
+        callId = PhoneCallUtil::CallIdByState( EPEStateHeld );
+        if ( callId == KErrNotFound ) 
             {
             // find the disconnected call.
-            callStateData.SetCallState( EPEStateDisconnecting );
-            iViewCommandHandle->HandleCommandL(
-                    EPhoneViewGetCallIdByState, &callStateData );    
+            callId = PhoneCallUtil::CallIdByState( EPEStateDisconnecting );  
             }
         }
-    iCallId = callStateData.CallId();      
+    iCallId = callId;      
     }
 
 // -----------------------------------------------------------