7#include "cdmasetting.h"
8#include "cdmasetting_p.h"
12NetworkManager::CdmaSettingPrivate::CdmaSettingPrivate()
13 : name(NM_SETTING_CDMA_SETTING_NAME)
14 , passwordFlags(Setting::
None)
18NetworkManager::CdmaSetting::CdmaSetting()
19 : Setting(Setting::Cdma)
20 , d_ptr(new CdmaSettingPrivate())
24NetworkManager::CdmaSetting::CdmaSetting(
const Ptr &other)
26 , d_ptr(new CdmaSettingPrivate())
28 setUsername(other->username());
29 setNumber(other->number());
30 setPassword(other->password());
31 setPasswordFlags(other->passwordFlags());
34NetworkManager::CdmaSetting::~CdmaSetting()
46void NetworkManager::CdmaSetting::setNumber(
const QString &number)
53QString NetworkManager::CdmaSetting::number()
const
55 Q_D(
const CdmaSetting);
60void NetworkManager::CdmaSetting::setUsername(
const QString &username)
64 d->username = username;
67QString NetworkManager::CdmaSetting::username()
const
69 Q_D(
const CdmaSetting);
74void NetworkManager::CdmaSetting::setPassword(
const QString &password)
78 d->password = password;
81QString NetworkManager::CdmaSetting::password()
const
83 Q_D(
const CdmaSetting);
92 d->passwordFlags = flags;
97 Q_D(
const CdmaSetting);
99 return d->passwordFlags;
102QStringList NetworkManager::CdmaSetting::needSecrets(
bool requestNew)
const
105 if (!username().isEmpty()) {
106 if ((password().isEmpty() || requestNew) && !passwordFlags().testFlag(NotRequired)) {
114void NetworkManager::CdmaSetting::secretsFromMap(
const QVariantMap &secrets)
116 if (secrets.contains(
QLatin1String(NM_SETTING_CDMA_PASSWORD))) {
121QVariantMap NetworkManager::CdmaSetting::secretsToMap()
const
125 if (!password().isEmpty()) {
126 secrets.insert(
QLatin1String(NM_SETTING_CDMA_PASSWORD), password());
134 if (setting.contains(
QLatin1String(NM_SETTING_CDMA_NUMBER))) {
135 setNumber(setting.value(
QLatin1String(NM_SETTING_CDMA_NUMBER)).toString());
138 if (setting.contains(
QLatin1String(NM_SETTING_CDMA_USERNAME))) {
139 setUsername(setting.value(
QLatin1String(NM_SETTING_CDMA_USERNAME)).toString());
143 if (setting.contains(
QLatin1String(NM_SETTING_CDMA_PASSWORD))) {
144 setPassword(setting.value(
QLatin1String(NM_SETTING_CDMA_PASSWORD)).toString());
147 if (setting.contains(
QLatin1String(NM_SETTING_CDMA_PASSWORD_FLAGS))) {
156 if (!number().isEmpty()) {
157 setting.insert(
QLatin1String(NM_SETTING_CDMA_NUMBER), number());
160 if (!username().isEmpty()) {
161 setting.insert(
QLatin1String(NM_SETTING_CDMA_USERNAME), username());
165 if (!password().isEmpty()) {
166 setting.insert(
QLatin1String(NM_SETTING_CDMA_PASSWORD), password());
169 if (passwordFlags() != None) {
170 setting.insert(
QLatin1String(NM_SETTING_CDMA_PASSWORD_FLAGS), (
int)passwordFlags());
178 dbg.
nospace() <<
"type: " << setting.typeAsString(setting.type()) <<
'\n';
179 dbg.
nospace() <<
"initialized: " << !setting.isNull() <<
'\n';
181 dbg.
nospace() << NM_SETTING_CDMA_NUMBER <<
": " << setting.number() <<
'\n';
182 dbg.
nospace() << NM_SETTING_CDMA_USERNAME <<
": " << setting.username() <<
'\n';
183 dbg.
nospace() << NM_SETTING_CDMA_PASSWORD <<
": " << setting.password() <<
'\n';
184 dbg.
nospace() << NM_SETTING_CDMA_PASSWORD_FLAGS <<
": " << setting.passwordFlags() <<
'\n';
QVariantMap toMap() const override
Must be reimplemented, default implementationd does nothing.
void fromMap(const QVariantMap &setting) override
Must be reimplemented, default implementation does nothing.
QString name() const override
Must be reimplemented, default implementationd does nothing.
char * toString(const EngineQuery &query)