From 93e68756bcfceeff7e033e3709501c4027185277 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Sat, 9 May 2020 16:54:22 +0200 Subject: [PATCH] Port away from deprecated error signal --- core/backends/lan/compositeuploadjob.cpp | 4 ++++ core/backends/lan/lanlinkprovider.cpp | 8 ++++++++ core/filetransferjob.cpp | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/core/backends/lan/compositeuploadjob.cpp b/core/backends/lan/compositeuploadjob.cpp index 8b90fecd8..e5f88ac57 100644 --- a/core/backends/lan/compositeuploadjob.cpp +++ b/core/backends/lan/compositeuploadjob.cpp @@ -151,7 +151,11 @@ void CompositeUploadJob::newConnection() m_currentJob->setSocket(m_socket); connect(m_socket, &QSslSocket::disconnected, this, &CompositeUploadJob::socketDisconnected); +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) connect(m_socket, QOverload::of(&QAbstractSocket::error), this, &CompositeUploadJob::socketError); +#else + connect(m_socket, &QAbstractSocket::errorOccurred, this, &CompositeUploadJob::socketError); +#endif connect(m_socket, QOverload &>::of(&QSslSocket::sslErrors), this, &CompositeUploadJob::sslError); connect(m_socket, &QSslSocket::encrypted, this, &CompositeUploadJob::encrypted); diff --git a/core/backends/lan/lanlinkprovider.cpp b/core/backends/lan/lanlinkprovider.cpp index 0c200a4f2..d9a7d8fa3 100644 --- a/core/backends/lan/lanlinkprovider.cpp +++ b/core/backends/lan/lanlinkprovider.cpp @@ -228,7 +228,11 @@ void LanLinkProvider::udpBroadcastReceived() m_receivedIdentityPackets[socket].np = receivedPacket; m_receivedIdentityPackets[socket].sender = sender; connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::tcpSocketConnected); +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) connect(socket, QOverload::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError); +#else + connect(socket, &QAbstractSocket::errorOccurred, this, &LanLinkProvider::connectError); +#endif socket->connectToHost(sender, tcpPort); } } @@ -258,7 +262,11 @@ void LanLinkProvider::tcpSocketConnected() if (!socket) return; // TODO Delete me? +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) disconnect(socket, QOverload::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError); +#else + disconnect(socket, &QAbstractSocket::errorOccurred, this, &LanLinkProvider::connectError); +#endif configureSocket(socket); diff --git a/core/filetransferjob.cpp b/core/filetransferjob.cpp index 5b7f0e1e9..a9ccdcab8 100644 --- a/core/filetransferjob.cpp +++ b/core/filetransferjob.cpp @@ -99,8 +99,12 @@ void FileTransferJob::startTransfer() m_written = bytesSent; }); +#if QT_VERSION < QT_VERSION_CHECK(5,15,0) connect(m_reply, static_cast(&QNetworkReply::error), this, &FileTransferJob::transferFailed); +#else + connect(m_reply, &QNetworkReply::errorOccurred, this, &FileTransferJob::transferFailed); +#endif connect(m_reply, &QNetworkReply::finished, this, &FileTransferJob::transferFinished); }