vpnengine/vpncleaner/src/vpncleanerexe.cpp
changeset 17 8962128a2656
parent 3 2df28d7a2299
child 21 5aacbb121f34
equal deleted inserted replaced
4:29b591713d44 17:8962128a2656
    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>
       
    22 
    20 
    23 #include "vpncleaner.h"
    21 #include "vpncleaner.h"
    24 
    22 
    25 
    23 
    26 LOCAL_C void  setKeysL();
       
    27 LOCAL_C TBool vpnOnRom();
    24 LOCAL_C TBool vpnOnRom();
    28 
    25 
    29 
    26 
    30 // The starting point
    27 // The starting point
    31 GLDEF_C TInt E32Main()
    28 GLDEF_C TInt E32Main()
    36 
    33 
    37     if( EFalse == vpnOnRom() )
    34     if( EFalse == vpnOnRom() )
    38         {
    35         {
    39         TVpnCleaner vpnc;
    36         TVpnCleaner vpnc;
    40         vpnc.Clean();
    37         vpnc.Clean();
    41 
       
    42         TRAP_IGNORE( setKeysL() );
       
    43         }
    38         }
    44 
    39 
    45     delete cleanup;
    40     delete cleanup;
    46 
    41 
    47     __UHEAP_MARKEND;
    42     __UHEAP_MARKEND;
    48     return KErrNone;
    43     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;
       
    62     }
    44     }
    63 
    45 
    64 
    46 
    65 LOCAL_C TBool vpnOnRom()
    47 LOCAL_C TBool vpnOnRom()
    66     {
    48     {