Update device name on reconnection

Since the remote device can now change its name, re-read the device name from
the identityPackage

REVIEW: 113203
This commit is contained in:
Mauro Panzeri 2013-10-14 18:25:44 +02:00 committed by Albert Vaca
parent f68d336e88
commit 63488781b9

View file

@ -200,6 +200,9 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link)
m_deviceLinks.append(link);
//re-read the device name from the identityPackage because it could have changed
m_deviceName = identityPackage.get<QString>("deviceName");
//TODO: Do not read the key every time
KSharedConfigPtr config = KSharedConfig::openConfig("kdeconnectrc");
const QString& key = config->group("myself").readEntry<QString>("privateKey",QString());