[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:29:58 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=7da30dd
The following commit has been merged in the master branch:
commit 7da30ddbb1d957d4fb13665c78028391536ad848
Author: Albert Vaca <albertvaka at gmail.com>
Date: Tue Jul 12 12:34:56 2016 +0200
Use the pairing handler instead of accessing the device directly on error
---
core/backends/lan/lanlinkprovider.cpp | 10 ++++------
core/daemon.h | 1 +
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp
index 7fe58f8..451028e 100644
--- a/core/backends/lan/lanlinkprovider.cpp
+++ b/core/backends/lan/lanlinkprovider.cpp
@@ -287,6 +287,8 @@ void LanLinkProvider::sslErrors(const QList<QSslError>& errors)
disconnect(socket, SIGNAL(encrypted()), this, SLOT(encrypted()));
disconnect(socket, SIGNAL(sslErrors(QList<QSslError>)), this, SLOT(sslErrors(QList<QSslError>)));
+ QString deviceId = socket->peerVerifyName();
+
Q_FOREACH (const QSslError &error, errors) {
switch (error.error()) {
case QSslError::CertificateSignatureFailed:
@@ -295,11 +297,8 @@ void LanLinkProvider::sslErrors(const QList<QSslError>& errors)
case QSslError::CertificateUntrusted:
case QSslError::SelfSignedCertificate: {
qCDebug(KDECONNECT_CORE) << "Failing due to " << error.errorString();
- // Due to simultaneous multiple connections, it may be possible that device instance does not exist anymore
- Device *device = Daemon::instance()->getDevice(socket->peerVerifyName());
- if (device != Q_NULLPTR) {
- device->unpair();
- }
+ LanPairingHandler* ph = createPairingHandler(mLinks.value(deviceId));
+ ph->unpair();
break;
}
default:
@@ -395,7 +394,6 @@ void LanLinkProvider::deviceLinkDestroyed(QObject* destroyedDeviceLink)
mLinks.erase(linkIterator);
mPairingHandlers.remove(id);
}
-
}
void LanLinkProvider::configureSslSocket(QSslSocket* socket, const QString& deviceId, bool isDeviceTrusted)
diff --git a/core/daemon.h b/core/daemon.h
index 8b3fab0..c9e27c4 100644
--- a/core/daemon.h
+++ b/core/daemon.h
@@ -52,6 +52,7 @@ public:
virtual void reportError(const QString &title, const QString &description) = 0;
virtual QNetworkAccessManager* networkAccessManager();
+protected:
Device* getDevice(const QString& deviceId);
public Q_SLOTS:
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list