vpnengine/vpnins/src/vpninsexe.cpp
branchRCL_3
changeset 41 e06095241a65
parent 40 473321461bba
equal deleted inserted replaced
40:473321461bba 41:e06095241a65
     1 /*
     1 /*
     2 * Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 
    19 
    20 #include <e32base.h>
    20 #include <e32base.h>
    21 #include <certificateapps.h>
       
    22 
    21 
    23 LOCAL_C void setSettingsL();
    22     #include <centralrepository.h> // link against centralrepository.lib
       
    23     #include <settingsinternalcrkeys.h>
       
    24 
       
    25     #include <certificateapps.h>
       
    26 
       
    27 
       
    28 _LIT(KVpnManagementUiDllName, "vpnmanagementui.dll");
       
    29 
       
    30 LOCAL_C void setKeysAndOtherSettingsL();
    24 
    31 
    25 // The starting point
    32 // The starting point
    26 GLDEF_C TInt E32Main()
    33 GLDEF_C TInt E32Main()
    27     {
    34     {
    28     __UHEAP_MARK;
    35     __UHEAP_MARK;
    29     CTrapCleanup* cleanup = CTrapCleanup::New();
    36     CTrapCleanup* cleanup = CTrapCleanup::New();
    30     TRAPD(error, setSettingsL());
    37     TRAPD(error, setKeysAndOtherSettingsL());
    31     if (error != KErrNone)
    38     if (error != KErrNone)
    32         {
    39         {
    33         ;
    40         ;
    34         }
    41         }
    35     delete cleanup;
    42     delete cleanup;
    36     __UHEAP_MARKEND;
    43     __UHEAP_MARKEND;
    37     return 0;
    44     return 0;
    38     }
    45     }
    39 
    46 
    40  
    47  
    41 LOCAL_C void setSettingsL()
    48 LOCAL_C void setKeysAndOtherSettingsL()
    42     {
    49     {
       
    50     // Connecting and initialization:
       
    51     CRepository* repository = CRepository::NewL( KCRUidCommunicationSettings );
       
    52     repository->Set( KSettingsVPNSupported, 1 );
       
    53     repository->Set( KSettingsVPNImplementation, KVpnManagementUiDllName );
       
    54     delete repository;
       
    55 
    43     CCertificateAppInfoManager* manager = CCertificateAppInfoManager::NewLC();
    56     CCertificateAppInfoManager* manager = CCertificateAppInfoManager::NewLC();
    44     
    57     
    45     const TUid KUidVpn = {0x101F7993};
    58     const TUid KUidVpn = {0x101F7993};
    46     _LIT(KVpnApplicationName, "VPN");
    59     _LIT(KVpnApplicationName, "VPN");
    47     TName vpnApplicationName(KVpnApplicationName);
    60     TName vpnApplicationName(KVpnApplicationName);