Port away from deprecated error signal
This commit is contained in:
parent
1cf5932c42
commit
93e68756bc
3 changed files with 16 additions and 0 deletions
|
@ -151,7 +151,11 @@ void CompositeUploadJob::newConnection()
|
||||||
m_currentJob->setSocket(m_socket);
|
m_currentJob->setSocket(m_socket);
|
||||||
|
|
||||||
connect(m_socket, &QSslSocket::disconnected, this, &CompositeUploadJob::socketDisconnected);
|
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);
|
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, QOverload<const QList<QSslError> &>::of(&QSslSocket::sslErrors), this, &CompositeUploadJob::sslError);
|
||||||
connect(m_socket, &QSslSocket::encrypted, this, &CompositeUploadJob::encrypted);
|
connect(m_socket, &QSslSocket::encrypted, this, &CompositeUploadJob::encrypted);
|
||||||
|
|
||||||
|
|
|
@ -228,7 +228,11 @@ void LanLinkProvider::udpBroadcastReceived()
|
||||||
m_receivedIdentityPackets[socket].np = receivedPacket;
|
m_receivedIdentityPackets[socket].np = receivedPacket;
|
||||||
m_receivedIdentityPackets[socket].sender = sender;
|
m_receivedIdentityPackets[socket].sender = sender;
|
||||||
connect(socket, &QAbstractSocket::connected, this, &LanLinkProvider::tcpSocketConnected);
|
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);
|
connect(socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError);
|
||||||
|
#else
|
||||||
|
connect(socket, &QAbstractSocket::errorOccurred, this, &LanLinkProvider::connectError);
|
||||||
|
#endif
|
||||||
socket->connectToHost(sender, tcpPort);
|
socket->connectToHost(sender, tcpPort);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -258,7 +262,11 @@ void LanLinkProvider::tcpSocketConnected()
|
||||||
|
|
||||||
if (!socket) return;
|
if (!socket) return;
|
||||||
// TODO Delete me?
|
// TODO Delete me?
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
|
||||||
disconnect(socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError);
|
disconnect(socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error), this, &LanLinkProvider::connectError);
|
||||||
|
#else
|
||||||
|
disconnect(socket, &QAbstractSocket::errorOccurred, this, &LanLinkProvider::connectError);
|
||||||
|
#endif
|
||||||
|
|
||||||
configureSocket(socket);
|
configureSocket(socket);
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,12 @@ void FileTransferJob::startTransfer()
|
||||||
|
|
||||||
m_written = bytesSent;
|
m_written = bytesSent;
|
||||||
});
|
});
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5,15,0)
|
||||||
connect(m_reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
|
connect(m_reply, static_cast<void (QNetworkReply::*)(QNetworkReply::NetworkError)>(&QNetworkReply::error),
|
||||||
this, &FileTransferJob::transferFailed);
|
this, &FileTransferJob::transferFailed);
|
||||||
|
#else
|
||||||
|
connect(m_reply, &QNetworkReply::errorOccurred, this, &FileTransferJob::transferFailed);
|
||||||
|
#endif
|
||||||
connect(m_reply, &QNetworkReply::finished, this, &FileTransferJob::transferFinished);
|
connect(m_reply, &QNetworkReply::finished, this, &FileTransferJob::transferFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue