Changeset View
Changeset View
Standalone View
Standalone View
kded/secretagent.cpp
Show All 33 Lines | |||||
34 | #include <NetworkManagerQt/Security8021xSetting> | 34 | #include <NetworkManagerQt/Security8021xSetting> | ||
35 | #include <NetworkManagerQt/VpnSetting> | 35 | #include <NetworkManagerQt/VpnSetting> | ||
36 | #include <NetworkManagerQt/WirelessSecuritySetting> | 36 | #include <NetworkManagerQt/WirelessSecuritySetting> | ||
37 | #include <NetworkManagerQt/WirelessSetting> | 37 | #include <NetworkManagerQt/WirelessSetting> | ||
38 | 38 | | |||
39 | #include <QStringBuilder> | 39 | #include <QStringBuilder> | ||
40 | #include <QDialog> | 40 | #include <QDialog> | ||
41 | 41 | | |||
42 | #include <KLocalizedString> | ||||
42 | #include <KPluginFactory> | 43 | #include <KPluginFactory> | ||
43 | #include <KWindowSystem> | 44 | #include <KWindowSystem> | ||
44 | #include <KConfig> | 45 | #include <KConfig> | ||
45 | #include <KConfigGroup> | 46 | #include <KConfigGroup> | ||
46 | #include <KWallet> | 47 | #include <KWallet> | ||
47 | 48 | | |||
48 | SecretAgent::SecretAgent(QObject* parent) | 49 | SecretAgent::SecretAgent(QObject* parent) | ||
49 | : NetworkManager::SecretAgent("org.kde.plasma.networkmanagement", parent) | 50 | : NetworkManager::SecretAgent("org.kde.plasma.networkmanagement", parent) | ||
▲ Show 20 Lines • Show All 353 Lines • ▼ Show 20 Line(s) | 402 | if (!isVpn && setting->needSecrets(requestNew).isEmpty()) { | |||
403 | request.connection[request.setting_name] = setting->secretsToMap(); | 404 | request.connection[request.setting_name] = setting->secretsToMap(); | ||
404 | sendSecrets(request.connection, request.message); | 405 | sendSecrets(request.connection, request.message); | ||
405 | return true; | 406 | return true; | ||
406 | } | 407 | } | ||
407 | } | 408 | } | ||
408 | 409 | | |||
409 | if (!Configuration::showPasswordDialog()) { | 410 | if (!Configuration::showPasswordDialog()) { | ||
410 | sendError(SecretAgent::NoSecrets, "Cannot authenticate", request.message); | 411 | sendError(SecretAgent::NoSecrets, "Cannot authenticate", request.message); | ||
412 | emit secretsError(request.connection_path.path(), i18n("Authentication to %1 failed. Wrong password?", request.connection.value("connection").value("id").toString())); | ||||
jgrulich: I'm not sure this assumption is currect, it's not that the password is wrong all the time, NM… | |||||
411 | return true; | 413 | return true; | ||
412 | } else if (requestNew || (allowInteraction && !setting->needSecrets(requestNew).isEmpty()) || (allowInteraction && userRequested) || (isVpn && allowInteraction)) { | 414 | } else if (requestNew || (allowInteraction && !setting->needSecrets(requestNew).isEmpty()) || (allowInteraction && userRequested) || (isVpn && allowInteraction)) { | ||
413 | m_dialog = new PasswordDialog(connectionSettings, request.flags, request.setting_name); | 415 | m_dialog = new PasswordDialog(connectionSettings, request.flags, request.setting_name); | ||
414 | connect(m_dialog, &PasswordDialog::accepted, this, &SecretAgent::dialogAccepted); | 416 | connect(m_dialog, &PasswordDialog::accepted, this, &SecretAgent::dialogAccepted); | ||
415 | connect(m_dialog, &PasswordDialog::rejected, this, &SecretAgent::dialogRejected); | 417 | connect(m_dialog, &PasswordDialog::rejected, this, &SecretAgent::dialogRejected); | ||
416 | 418 | | |||
417 | if (m_dialog->hasError()) { | 419 | if (m_dialog->hasError()) { | ||
418 | sendError(m_dialog->error(), | 420 | sendError(m_dialog->error(), | ||
▲ Show 20 Lines • Show All 232 Lines • Show Last 20 Lines |
I'm not sure this assumption is currect, it's not that the password is wrong all the time, NM might be just asking for additional passwords or for passwords which are marked not to be stored (e.g. VPN, or WPA2 EAP). But I guess for your usecase we can leave it as it is, we just need to make sure that Configuration::showPasswordDialog() will be true only on plasma-mobile.