vpnengine/vpncleaner/src/vpncleanerexe.cpp
branchRCL_3
changeset 41 e06095241a65
parent 40 473321461bba
equal deleted inserted replaced
40:473321461bba 41:e06095241a65
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <e32base.h>
    18 #include <e32base.h>
    19 #include <f32file.h>
    19 #include <f32file.h>
       
    20 #include <centralrepository.h> // link against centralrepository.lib
       
    21 #include <settingsinternalcrkeys.h>
    20 
    22 
    21 #include "vpncleaner.h"
    23 #include "vpncleaner.h"
    22 
    24 
    23 
    25 
       
    26 LOCAL_C void  setKeysL();
    24 LOCAL_C TBool vpnOnRom();
    27 LOCAL_C TBool vpnOnRom();
    25 
    28 
    26 
    29 
    27 // The starting point
    30 // The starting point
    28 GLDEF_C TInt E32Main()
    31 GLDEF_C TInt E32Main()
    33 
    36 
    34     if( EFalse == vpnOnRom() )
    37     if( EFalse == vpnOnRom() )
    35         {
    38         {
    36         TVpnCleaner vpnc;
    39         TVpnCleaner vpnc;
    37         vpnc.Clean();
    40         vpnc.Clean();
       
    41 
       
    42         TRAP_IGNORE( setKeysL() );
    38         }
    43         }
    39 
    44 
    40     delete cleanup;
    45     delete cleanup;
    41 
    46 
    42     __UHEAP_MARKEND;
    47     __UHEAP_MARKEND;
    43     return KErrNone;
    48     return KErrNone;
       
    49     }
       
    50 
       
    51 
       
    52 LOCAL_C void setKeysL()
       
    53     {
       
    54     // Connecting and initialization:
       
    55     CRepository* repository = CRepository::NewL(
       
    56         KCRUidCommunicationSettings );
       
    57 
       
    58     repository->Set( KSettingsVPNSupported, 0 );
       
    59     repository->Delete( KSettingsVPNImplementation );
       
    60 
       
    61     delete repository;
    44     }
    62     }
    45 
    63 
    46 
    64 
    47 LOCAL_C TBool vpnOnRom()
    65 LOCAL_C TBool vpnOnRom()
    48     {
    66     {