diff --git a/core/backends/devicelink.h b/core/backends/devicelink.h index b9de66ad7..5982272e5 100644 --- a/core/backends/devicelink.h +++ b/core/backends/devicelink.h @@ -63,6 +63,7 @@ public: Q_SIGNALS: void receivedPackage(const NetworkPackage& np); void pairStatusChanged(DeviceLink::PairStatus status); + void pairingError(const QString &error); protected: QCA::PrivateKey mPrivateKey; diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index 990b6188d..d726c4afe 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -471,7 +471,8 @@ void LanLinkProvider::userRequestsPair(const QString& deviceId) void LanLinkProvider::refreshPairingHandler(const QString& deviceId) { LanPairingHandler* ph = mPairingHandlers.value(deviceId); if (ph) { - ph->setDeviceLink(mLinks[deviceId]); - + DeviceLink* link = mLinks[deviceId]; + ph->setDeviceLink(link); + connect(ph, &LanPairingHandler::pairingError, link, &DeviceLink::pairingError); } } diff --git a/core/device.cpp b/core/device.cpp index b99ccefb0..afeff20f9 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -271,8 +271,8 @@ void Device::addLink(const NetworkPackage& identityPackage, DeviceLink* link) } } - connect(link, SIGNAL(pairStatusChanged(PairStatus)), this, SLOT(pairStatusChanged(PairStatus, PairStatus))); - connect(link, SIGNAL(pairingFailed(const QString&)), this, SIGNAL(pairingFailed(const QString&))); + connect(link, &DeviceLink::pairStatusChanged, this, &Device::pairStatusChanged); + connect(link, &DeviceLink::pairingError, this, &Device::pairingError); } void Device::linkDestroyed(QObject* o)