26
|
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 the License "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 method QT configuration
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
|
|
19 |
/*
|
27
|
20 |
* %version: 9 %
|
26
|
21 |
*/
|
|
22 |
|
|
23 |
#include "eapqtconfig.h"
|
|
24 |
#include "eapqtconfig_p.h"
|
|
25 |
|
|
26 |
//----------------------------------------------------------------------------
|
|
27 |
// EapQtConfig
|
|
28 |
//----------------------------------------------------------------------------
|
|
29 |
|
|
30 |
EapQtConfig::EapQtConfig() :
|
|
31 |
d_ptr(new EapQtConfigPrivate)
|
|
32 |
{
|
|
33 |
}
|
|
34 |
|
|
35 |
EapQtConfig::~EapQtConfig()
|
|
36 |
{
|
|
37 |
// scoped pointer deleted automatically
|
|
38 |
}
|
|
39 |
|
|
40 |
QVariant EapQtConfig::value(SettingsId id)
|
|
41 |
{
|
|
42 |
// check for valid range, otherwise memory is consumed for no reason
|
|
43 |
if(id >= SettingsIdLast) {
|
|
44 |
qDebug("ERROR: EapQtConfig::value - invalid id!");
|
|
45 |
return QVariant::Invalid;
|
|
46 |
}
|
|
47 |
return d_ptr->mSettings[id];
|
|
48 |
}
|
|
49 |
|
|
50 |
void EapQtConfig::setValue(SettingsId id, QVariant newValue)
|
|
51 |
{
|
|
52 |
// check for valid range, otherwise memory is consumed for no reason
|
|
53 |
if(id < SettingsIdLast) {
|
|
54 |
d_ptr->mSettings[id] = newValue;
|
|
55 |
} else {
|
|
56 |
qDebug("ERROR: EapQtConfig::setValue - invalid id!");
|
|
57 |
}
|
|
58 |
return;
|
|
59 |
}
|
|
60 |
|
|
61 |
void EapQtConfig::clear() {
|
|
62 |
d_ptr->mSettings.clear();
|
|
63 |
return;
|
|
64 |
}
|
|
65 |
|
|
66 |
QList<EapQtConfig::SettingsId> EapQtConfig::validate(
|
|
67 |
QList<EapQtConfig::SettingsId> ids)
|
|
68 |
{
|
27
|
69 |
// not supported
|
26
|
70 |
Q_UNUSED(ids);
|
|
71 |
return QList<EapQtConfig::SettingsId>();
|
|
72 |
}
|
|
73 |
|
|
74 |
|