Commit 8fc5d854 authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Since NM guys are being too slow to fix this bug I am adding this hack until

they fix it for good. Please try and see if it does not bring new bugs.

CCBUG: 276486
parent f6cc7df6
......@@ -338,18 +338,22 @@ void NMDBusSettingsConnectionProvider::updateConnection(const QString &uuid, Knm
ConnectionDbus converter(newConnection);
QVariantMapMap map = converter.toDbusMap();
/*
* Until NM guys fix the bug described in fix http://bugs.kde.org/276486 let's use the hack
* in the "else" clause below to force NM to update secrets.
if (newConnection->name() == remote->id()) {
remote->Update(map);
} else {
} else*/ {
/* If connection's name (id in NM's termonology) changes during an Update
* NM will leave the old connection file intact and create a new connection file
* in /etc/NetworkManager/system-connections/ with the same uuid, which is wrong in my oppinion.
* Furthermore the old connection will not be shown in connection list because we use the uuid
* as connection identifier.
* Furthermore the old connection will not be shown in Plasma NM's connection list
* because we use connection's uuid as connection identifier.
* Deleting the old connection and creating a new one seems to work.
*/
QDBusPendingCall reply = remote->Delete();
reply.waitForFinished();
sleep(1);
addConnection(newConnection);
}
......@@ -400,7 +404,6 @@ void NMDBusSettingsConnectionProvider::onConnectionAddArrived(QDBusPendingCallWa
{
Q_D(NMDBusSettingsConnectionProvider);
QDBusObjectPath objPath = reply.argumentAt<0>();
emit addConnectionCompleted(true, QString());
// Hack to force NetworkManager to call the secrets agent to save this connections's secrets.
// This does not work for VPN connections.
......@@ -408,9 +411,11 @@ void NMDBusSettingsConnectionProvider::onConnectionAddArrived(QDBusPendingCallWa
QString uuid = d->uuidToPath.key(objPath.path(), QUuid()).toString();
RemoteConnection *remote = d->connections.value(uuid);
QVariantMapMap map = d->secretsToSave.take(uuid);
sleep(1);
remote->Update(map);
kDebug() << "Connection added successfully: " << objPath.path() << uuid;
emit addConnectionCompleted(true, QString());
}
watcher->deleteLater();
......
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