satui/satapp/tsrc/ut_satapp/src/ut_satappmainhandler.cpp
changeset 45 61f927bc9441
parent 39 cee7e9e0906c
equal deleted inserted replaced
39:cee7e9e0906c 45:61f927bc9441
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 #include <hbmainwindow.h>
    19 #include <hbmainwindow.h>
    20 #include <centralrepository.h>
    20 #include <centralrepository.h>
    21 #include <ProfileEngineSDKCRKeys.h>
    21 #include <coreapplicationuissdkcrkeys.h>
    22 #include "ut_satappmainhandler.h"
    22 #include "ut_satappmainhandler.h"
    23 //test class
    23 //test class
    24 #include "satappmainhandler.h"
    24 #include "satappmainhandler.h"
    25 #include "satappconstant.h"
    25 #include "satappconstant.h"
    26 
    26 
    95 {
    95 {
    96     qDebug("Ut_SatAppMainHandler::testCreateMainHandler_OfflineMode >");
    96     qDebug("Ut_SatAppMainHandler::testCreateMainHandler_OfflineMode >");
    97     cleanupTestCase();
    97     cleanupTestCase();
    98     TInt profileId(0);
    98     TInt profileId(0);
    99     CRepository* cr (NULL);
    99     CRepository* cr (NULL);
   100     TRAPD(err, cr = CRepository::NewL(KCRUidProfileEngine));
   100     TRAPD(err, cr = CRepository::NewL(KCRUidCoreApplicationUIs));
   101     if ( KErrNone == err )
   101     if ( KErrNone == err )
   102     {
   102     {
   103         // Get the ID of the currently active profile:
   103         // Get the ID of the currently active profile:
   104         TInt error = cr->Get(KProEngActiveProfile, profileId);
   104         TInt error = cr->Get(KCoreAppUIsNetworkConnectionAllowed, profileId);
   105         qDebug("Ut_SatAppMainHandler::SatAppMainHandler get active \
   105         qDebug("Ut_SatAppMainHandler::SatAppMainHandler get active \
   106                 profile error=%d, profileId=%d", error, profileId);
   106                 profile error=%d, profileId=%d", error, profileId);
   107         if( KErrNone != error){
   107         if( KErrNone != error){
   108             delete cr;
   108             delete cr;
   109             return;
   109             return;
   110         }
   110         }
   111         error = cr->Set(KProEngActiveProfile,
   111         error = cr->Set(KCoreAppUIsNetworkConnectionAllowed,
   112                 KSatActiveProfileOffline);
   112             ECoreAppUIsNetworkConnectionNotAllowed);
   113         qDebug("Ut_SatAppMainHandler::SatAppMainHandler set active \
   113         qDebug("Ut_SatAppMainHandler::SatAppMainHandler set active \
   114                 profile error=%d",error);
   114                 profile error=%d",error);
   115         mMainHandler = new SatAppMainHandler(*mMainWindow);
   115         mMainHandler = new SatAppMainHandler(*mMainWindow);
   116         QVERIFY(mMainHandler); 
   116         QVERIFY(mMainHandler); 
   117         error = cr->Set(KProEngActiveProfile, profileId);
   117         error = cr->Set(KCoreAppUIsNetworkConnectionAllowed, profileId);
   118         qDebug("Ut_SatAppMainHandler::SatAppMainHandler set active \
   118         qDebug("Ut_SatAppMainHandler::SatAppMainHandler set active \
   119                 profile error=%d",error);
   119                 profile error=%d",error);
   120         delete cr;
   120         delete cr;
   121     }
   121     }
   122     
   122