Commit 917c121d authored by Lukáš Tinkl's avatar Lukáš Tinkl
Browse files

Fix #326632 - "Always Ask" and "Store" option in "Edit Connection" dialog seems swapped

BUG: 326632
parent 25153d13
......@@ -284,12 +284,12 @@ QVariantMap PptpSettingWidget::setting(bool agentOwned) const
void PptpSettingWidget::fillOnePasswordCombo(KComboBox * combo, NetworkManager::Setting::SecretFlags type)
{
if (type.testFlag(NetworkManager::Setting::AgentOwned) || type.testFlag(NetworkManager::Setting::None)) {
combo->setCurrentIndex(1);
} else if (type.testFlag(NetworkManager::Setting::NotRequired)) {
combo->setCurrentIndex(2);
} else if (type.testFlag(NetworkManager::Setting::NotSaved)) {
if (type.testFlag(NetworkManager::Setting::AgentOwned) || type.testFlag(NetworkManager::Setting::None)) { // store
combo->setCurrentIndex(0);
} else if (type.testFlag(NetworkManager::Setting::NotRequired)) { // not required
combo->setCurrentIndex(2);
} else if (type.testFlag(NetworkManager::Setting::NotSaved)) { // always ask
combo->setCurrentIndex(1);
}
}
......@@ -297,17 +297,17 @@ uint PptpSettingWidget::handleOnePasswordType(const KComboBox * combo, const QSt
{
const uint type = combo->currentIndex();
switch (type) {
case 0:
data.insert(key, QString::number(NetworkManager::Setting::NotSaved));
break;
case 1:
data.insert(key, QString::number(NetworkManager::Setting::NotSaved)); // always ask
break;
case 0:
if (agentOwned)
data.insert(key, QString::number(NetworkManager::Setting::AgentOwned));
data.insert(key, QString::number(NetworkManager::Setting::AgentOwned)); // store
else
data.insert(key, QString::number(NetworkManager::Setting::None));
break;
case 2:
data.insert(key, QString::number(NetworkManager::Setting::NotRequired));
data.insert(key, QString::number(NetworkManager::Setting::NotRequired)); // not required
break;
}
return type;
......
......@@ -201,7 +201,7 @@ void StrongswanSettingWidget::fillOnePasswordCombo(KComboBox * combo, const QStr
{
if (data.contains(key)) {
if (data.value(key) == NM_STRONGSWAN_PW_TYPE_SAVE) {
combo->setCurrentIndex(1);
combo->setCurrentIndex(0);
} else if (data.value(key) == NM_STRONGSWAN_PW_TYPE_UNUSED) {
combo->setCurrentIndex(2);
}
......@@ -214,10 +214,10 @@ uint StrongswanSettingWidget::handleOnePasswordType(const KComboBox * combo, con
{
const uint type = combo->currentIndex();
switch (type) {
case 0:
case 1:
data.insert(key, QString::number(NetworkManager::Setting::NotSaved));
break;
case 1:
case 0:
if (agentOwned)
data.insert(key, QString::number(NetworkManager::Setting::AgentOwned));
else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment