From 4bb0e742dd9f8cede51af590c4a228656e8a73d9 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Thu, 8 Jan 2015 13:44:19 +0100 Subject: [PATCH 1/9] Do not return an empty map with secrets This is causing some issues in secret agent from plasma-nm, because it always tries to store VPN secrets to KWallet even when the map is empty and when it loads this empty map later it overwrites the secrets we get from NetworkManager in GetSecrets method and thus when plasma-nm displays the auth dialog it doesn't have necessary secrets available. BUG:339296 CCBUG:309931 CCBUG:334474 --- src/settings/vpnsetting.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/settings/vpnsetting.cpp b/src/settings/vpnsetting.cpp index 6078114..6dd8cb7 100644 --- a/src/settings/vpnsetting.cpp +++ b/src/settings/vpnsetting.cpp @@ -121,7 +121,9 @@ void NetworkManager::VpnSetting::secretsFromMap(const QVariantMap &secrets) QVariantMap NetworkManager::VpnSetting::secretsToMap() const { QVariantMap secretsMap; - secretsMap.insert(QLatin1String(NM_SETTING_VPN_SECRETS), QVariant::fromValue(secrets())); + if (!secrets().isEmpty()) { + secretsMap.insert(QLatin1String(NM_SETTING_VPN_SECRETS), QVariant::fromValue(secrets())); + } // qCDebug(NMQT) << secretsMap; return secretsMap; -- 2.1.0