Port away from deprecated error signal

This commit is contained in:
Nicolas Fella 2020-05-09 16:54:22 +02:00
parent 1cf5932c42
commit 93e68756bc
3 changed files with 16 additions and 0 deletions

View file

@ -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<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &CompositeUploadJob::socketError);
#else
connect(m_socket, &QAbstractSocket::errorOccurred, this, &CompositeUploadJob::socketError);
#endif
connect(m_socket, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), this, &CompositeUploadJob::sslError);
connect(m_socket, &QSslSocket::encrypted, this, &CompositeUploadJob::encrypted);

View file

@ -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<QAbstractSocket::SocketError>::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<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError);
#else
disconnect(socket, &QAbstractSocket::errorOccurred, this, &LanLinkProvider::connectError);
#endif
configureSocket(socket);

View file

@ -99,8 +99,12 @@ void FileTransferJob::startTransfer()
m_written = bytesSent;
});
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
connect(m_reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
this, &FileTransferJob::transferFailed);
#else
connect(m_reply, &QNetworkReply::errorOccurred, this, &FileTransferJob::transferFailed);
#endif
connect(m_reply, &QNetworkReply::finished, this, &FileTransferJob::transferFinished);
}