securitysettings/qtconfigutils/eapqtconfiginterface/src/eapqtpacstoreconfig.cpp
changeset 39 fe6b6762fccd
equal deleted inserted replaced
38:7a0216d033ac 39:fe6b6762fccd
       
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *   EAP-FAST PAC store configuration data
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 2 %
       
    21  */
       
    22 
       
    23 // System includes
       
    24 #include <eapqtpacstoreconfig.h>
       
    25 
       
    26 // User includes
       
    27 #include "eapqtpacstoreconfig_p.h"
       
    28 
       
    29 /*!
       
    30  *  \class EapQtPacStoreConfig
       
    31  *  \brief Public implementation of EAP-FAST PAC store configuration data
       
    32  */
       
    33 
       
    34 // External function prototypes
       
    35 
       
    36 // Local constants
       
    37 
       
    38 // ======== LOCAL FUNCTIONS ========
       
    39 
       
    40 // ======== MEMBER FUNCTIONS ========
       
    41 
       
    42 EapQtPacStoreConfig::EapQtPacStoreConfig() :
       
    43     d_ptr(new EapQtPacStoreConfigPrivate)
       
    44 {
       
    45 }
       
    46 
       
    47 EapQtPacStoreConfig::~EapQtPacStoreConfig()
       
    48 {
       
    49     // scoped pointer deleted automatically
       
    50 }
       
    51 
       
    52 QVariant EapQtPacStoreConfig::value(const PacStoreSettings id) const
       
    53 {
       
    54     // check for valid range, otherwise memory is consumed for no reason
       
    55     if(id >= PacStoreLast) {
       
    56         qDebug("ERROR: EapQtPacStoreConfig::value - invalid id!");
       
    57         return QVariant::Invalid;
       
    58     }
       
    59     return d_ptr->mPacStoreSettings[id];
       
    60 }
       
    61 
       
    62 void EapQtPacStoreConfig::setValue(const PacStoreSettings id, const QVariant &newValue) const
       
    63 {
       
    64     // check for valid range, otherwise memory is consumed for no reason
       
    65     if (id < PacStoreLast) {
       
    66         d_ptr->mPacStoreSettings[id] = newValue;
       
    67     }
       
    68     else {
       
    69         qDebug("ERROR: EapQtPacStoreConfig::setValue - invalid id!");
       
    70     }
       
    71 }
       
    72 
       
    73 void EapQtPacStoreConfig::clear() const
       
    74 {
       
    75     d_ptr->mPacStoreSettings.clear();
       
    76 }