From cb26a4da69db434d4227bc16e41187f3db93c984 Mon Sep 17 00:00:00 2001 From: Alexander Akulich Date: Fri, 7 Feb 2020 17:29:33 +0300 Subject: [PATCH] QAbstractSocket: deprecate 'error' signal, use 'errorOccurred' instead [ChangeLog][Deprecation Notice] QAbstractSocket::error() (the signal) is deprecated; superseded by errorOccurred() Change-Id: I11e9c774d7c6096d1e9b37c451cf0b99188b6aad Reviewed-by: Timur Pocheptsov --- examples/network/doc/src/fortuneclient.qdoc | 6 +-- examples/network/fortuneclient/client.cpp | 2 +- examples/network/loopback/dialog.cpp | 5 +-- examples/network/network-chat/client.cpp | 3 +- examples/network/torrent/peerwireclient.cpp | 4 +- examples/network/torrent/torrentclient.cpp | 2 +- examples/network/torrent/torrentserver.cpp | 2 +- src/network/access/qftp.cpp | 6 +-- .../access/qhttpnetworkconnectionchannel.cpp | 2 +- .../access/qnetworkaccessdebugpipebackend.cpp | 2 +- src/network/socket/qabstractsocket.cpp | 34 +++++++++----- src/network/socket/qabstractsocket.h | 4 ++ src/network/socket/qhttpsocketengine.cpp | 2 +- src/network/socket/qlocalsocket.h | 4 +- src/network/socket/qlocalsocket_p.h | 4 +- src/network/socket/qlocalsocket_tcp.cpp | 6 +-- src/network/socket/qlocalsocket_unix.cpp | 6 +-- src/network/socket/qsocks5socketengine.cpp | 8 ++-- src/network/socket/qsocks5socketengine_p.h | 4 +- src/network/ssl/qsslsocket.cpp | 2 +- .../image/qimagereader/tst_qimagereader.cpp | 2 +- .../qnetworkreply/tst_qnetworkreply.cpp | 2 +- .../tst_qhttpsocketengine.cpp | 2 +- .../tst_qsocks5socketengine.cpp | 6 +-- .../socket/qtcpsocket/tst_qtcpsocket.cpp | 20 ++++----- .../socket/qudpsocket/tst_qudpsocket.cpp | 4 +- tests/auto/network/ssl/qocsp/tst_qocsp.cpp | 2 +- .../network/ssl/qsslsocket/tst_qsslsocket.cpp | 44 +++++++++---------- tests/manual/bearerex/datatransferer.cpp | 2 +- 29 files changed, 103 insertions(+), 89 deletions(-) diff --git a/examples/network/doc/src/fortuneclient.qdoc b/examples/network/doc/src/fortuneclient.qdoc index 544fa156b7a..4cb7544fc09 100644 --- a/examples/network/doc/src/fortuneclient.qdoc +++ b/examples/network/doc/src/fortuneclient.qdoc @@ -89,7 +89,7 @@ The only QTcpSocket signals we need in this example are QTcpSocket::readyRead(), signifying that data has been received, and - QTcpSocket::error(), which we will use to catch any connection errors: + QTcpSocket::errorOccurred(), which we will use to catch any connection errors: \dots \snippet fortuneclient/client.cpp 3 @@ -118,11 +118,11 @@ \li \e{An error occurs.} We need to inform the user if the connection failed or was broken. In this case, QTcpSocket will emit - \l{QTcpSocket::error()}{error()}, and \c Client::displayError() will be + \l{QTcpSocket::errorOccurred()}{errorOccurred()}, and \c Client::displayError() will be called. \endlist - Let's go through the \l{QTcpSocket::error()}{error()} case first: + Let's go through the \l{QTcpSocket::errorOccurred()}{errorOccurred()} case first: \snippet fortuneclient/client.cpp 13 diff --git a/examples/network/fortuneclient/client.cpp b/examples/network/fortuneclient/client.cpp index 0ccbf51df86..2daac33c2b7 100644 --- a/examples/network/fortuneclient/client.cpp +++ b/examples/network/fortuneclient/client.cpp @@ -121,7 +121,7 @@ Client::Client(QWidget *parent) //! [2] //! [3] connect(tcpSocket, &QIODevice::readyRead, this, &Client::readFortune); //! [2] //! [4] - connect(tcpSocket, QOverload::of(&QAbstractSocket::error), + connect(tcpSocket, &QAbstractSocket::errorOccurred, //! [3] this, &Client::displayError); //! [4] diff --git a/examples/network/loopback/dialog.cpp b/examples/network/loopback/dialog.cpp index d87f024031f..4037f4c0853 100644 --- a/examples/network/loopback/dialog.cpp +++ b/examples/network/loopback/dialog.cpp @@ -78,7 +78,7 @@ Dialog::Dialog(QWidget *parent) connect(&tcpClient, &QAbstractSocket::connected, this, &Dialog::startTransfer); connect(&tcpClient, &QIODevice::bytesWritten, this, &Dialog::updateClientProgress); - connect(&tcpClient, QOverload::of(&QAbstractSocket::error), + connect(&tcpClient, &QAbstractSocket::errorOccurred, this, &Dialog::displayError); QVBoxLayout *mainLayout = new QVBoxLayout; @@ -131,8 +131,7 @@ void Dialog::acceptConnection() connect(tcpServerConnection, &QIODevice::readyRead, this, &Dialog::updateServerProgress); - connect(tcpServerConnection, - QOverload::of(&QAbstractSocket::error), + connect(tcpServerConnection, &QAbstractSocket::errorOccurred, this, &Dialog::displayError); connect(tcpServerConnection, &QTcpSocket::disconnected, tcpServerConnection, &QTcpSocket::deleteLater); diff --git a/examples/network/network-chat/client.cpp b/examples/network/network-chat/client.cpp index d4511818132..fe35d535f44 100644 --- a/examples/network/network-chat/client.cpp +++ b/examples/network/network-chat/client.cpp @@ -102,8 +102,7 @@ void Client::newConnection(Connection *connection) { connection->setGreetingMessage(peerManager->userName()); - connect(connection, QOverload::of(&Connection::error), - this, &Client::connectionError); + connect(connection, &Connection::errorOccurred, this, &Client::connectionError); connect(connection, &Connection::disconnected, this, &Client::disconnected); connect(connection, &Connection::readyForUse, this, &Client::readyForUse); } diff --git a/examples/network/torrent/peerwireclient.cpp b/examples/network/torrent/peerwireclient.cpp index cea4ef53fa6..c30abd0e130 100644 --- a/examples/network/torrent/peerwireclient.cpp +++ b/examples/network/torrent/peerwireclient.cpp @@ -107,8 +107,8 @@ PeerWireClient::PeerWireClient(const QByteArray &peerId, QObject *parent) this, &PeerWireClient::readyRead); connect(&socket, &QTcpSocket::disconnected, this, &PeerWireClient::disconnected); - connect(&socket, QOverload::of(&QTcpSocket::error), - this, QOverload::of(&PeerWireClient::error)); + connect(&socket, &QTcpSocket::errorOccurred, + this, &PeerWireClient::errorOccurred); connect(&socket, &QTcpSocket::bytesWritten, this, &PeerWireClient::bytesWritten); connect(&socket, &QTcpSocket::stateChanged, diff --git a/examples/network/torrent/torrentclient.cpp b/examples/network/torrent/torrentclient.cpp index 6b11338f422..2ba44768618 100644 --- a/examples/network/torrent/torrentclient.cpp +++ b/examples/network/torrent/torrentclient.cpp @@ -843,7 +843,7 @@ void TorrentClient::initializeConnection(PeerWireClient *client) this, &TorrentClient::setupOutgoingConnection); connect(client, &PeerWireClient::disconnected, this, &TorrentClient::removeClient); - connect(client, QOverload::of(&PeerWireClient::error), + connect(client, &PeerWireClient::errorOccurred, this, &TorrentClient::removeClient); connect(client, &PeerWireClient::piecesAvailable, this, &TorrentClient::peerPiecesAvailable); diff --git a/examples/network/torrent/torrentserver.cpp b/examples/network/torrent/torrentserver.cpp index 215498194b6..7af958c27c3 100644 --- a/examples/network/torrent/torrentserver.cpp +++ b/examples/network/torrent/torrentserver.cpp @@ -80,7 +80,7 @@ void TorrentServer::incomingConnection(qintptr socketDescriptor) if (ConnectionManager::instance()->canAddConnection() && !clients.isEmpty()) { connect(client, &PeerWireClient::infoHashReceived, this, &TorrentServer::processInfoHash); - connect(client, QOverload::of(&PeerWireClient::error), + connect(client, &PeerWireClient::errorOccurred, this, QOverload<>::of(&TorrentServer::removeClient)); RateController::instance()->addSocket(client); ConnectionManager::instance()->addConnection(client); diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index cda800ce354..2589c64b1c4 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -324,7 +324,7 @@ void QFtpDTP::connectToHost(const QString & host, quint16 port) socket->setObjectName(QLatin1String("QFtpDTP Passive state socket")); connect(socket, SIGNAL(connected()), SLOT(socketConnected())); connect(socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); connect(socket, SIGNAL(disconnected()), SLOT(socketConnectionClosed())); connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(socketBytesWritten(qint64))); @@ -769,7 +769,7 @@ void QFtpDTP::setupSocket() socket->setObjectName(QLatin1String("QFtpDTP Active state socket")); connect(socket, SIGNAL(connected()), SLOT(socketConnected())); connect(socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); connect(socket, SIGNAL(disconnected()), SLOT(socketConnectionClosed())); connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(socketBytesWritten(qint64))); @@ -807,7 +807,7 @@ QFtpPI::QFtpPI(QObject *parent) : SLOT(connectionClosed())); connect(&commandSocket, SIGNAL(readyRead()), SLOT(readyRead())); - connect(&commandSocket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(&commandSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), SLOT(error(QAbstractSocket::SocketError))); connect(&dtp, SIGNAL(connectState(int)), diff --git a/src/network/access/qhttpnetworkconnectionchannel.cpp b/src/network/access/qhttpnetworkconnectionchannel.cpp index ccdb1cd6cd5..319c4953b10 100644 --- a/src/network/access/qhttpnetworkconnectionchannel.cpp +++ b/src/network/access/qhttpnetworkconnectionchannel.cpp @@ -157,7 +157,7 @@ void QHttpNetworkConnectionChannel::init() QObject::connect(socket, SIGNAL(disconnected()), this, SLOT(_q_disconnected()), Qt::DirectConnection); - QObject::connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), + QObject::connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(_q_error(QAbstractSocket::SocketError)), Qt::DirectConnection); diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index 03ffc696285..0029df41fe5 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -98,7 +98,7 @@ void QNetworkAccessDebugPipeBackend::open() // socket ready read -> we can push from socket to downstream connect(&socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError())); + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), SLOT(socketError())); connect(&socket, SIGNAL(disconnected()), SLOT(socketDisconnected())); connect(&socket, SIGNAL(connected()), SLOT(socketConnected())); // socket bytes written -> we can push more from upstream to socket diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 57dec59bc74..fb792e428f1 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -84,7 +84,7 @@ HostLookupState. If the host is found, QAbstractSocket enters ConnectingState and emits the hostFound() signal. When the connection has been established, it enters ConnectedState and - emits connected(). If an error occurs at any stage, error() is + emits connected(). If an error occurs at any stage, errorOccurred() is emitted. Whenever the state changes, stateChanged() is emitted. For convenience, isValid() returns \c true if the socket is ready for reading and writing, but note that the socket's state must be @@ -113,7 +113,7 @@ QAbstractSocket::UnconnectedState, and emits disconnected(). If you want to abort a connection immediately, discarding all pending data, call abort() instead. If the remote host closes the connection, - QAbstractSocket will emit error(QAbstractSocket::RemoteHostClosedError), + QAbstractSocket will emit errorOccurred(QAbstractSocket::RemoteHostClosedError), during which the socket state will still be ConnectedState, and then the disconnected() signal will be emitted. @@ -203,6 +203,14 @@ /*! \fn void QAbstractSocket::error(QAbstractSocket::SocketError socketError) + \obsolete + + Use errorOccurred() instead. +*/ + +/*! + \fn void QAbstractSocket::errorOccurred(QAbstractSocket::SocketError socketError) + \since 5.15 This signal is emitted after an error occurred. The \a socketError parameter describes the type of error that occurred. @@ -330,6 +338,7 @@ \value UnknownSocketError An unidentified error occurred. \sa QAbstractSocket::error() + \sa QAbstractSocket::errorOccurred() */ /*! @@ -988,7 +997,7 @@ void QAbstractSocketPrivate::startConnectingByName(const QString &host) } state = QAbstractSocket::UnconnectedState; - emit q->error(socketError); + emit q->errorOccurred(socketError); emit q->stateChanged(state); } @@ -1047,7 +1056,7 @@ void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo) state = QAbstractSocket::UnconnectedState; setError(QAbstractSocket::HostNotFoundError, QAbstractSocket::tr("Host not found")); emit q->stateChanged(state); - emit q->error(QAbstractSocket::HostNotFoundError); + emit q->errorOccurred(QAbstractSocket::HostNotFoundError); return; } @@ -1070,8 +1079,8 @@ void QAbstractSocketPrivate::_q_startConnecting(const QHostInfo &hostInfo) _q_testConnection(), this function takes the first address of the pending addresses list and tries to connect to it. If the connection succeeds, QAbstractSocket will emit - connected(). Otherwise, error(ConnectionRefusedError) or - error(SocketTimeoutError) is emitted. + connected(). Otherwise, errorOccurred(ConnectionRefusedError) or + errorOccurred(SocketTimeoutError) is emitted. */ void QAbstractSocketPrivate::_q_connectToNextAddress() { @@ -1101,7 +1110,7 @@ void QAbstractSocketPrivate::_q_connectToNextAddress() // q->setErrorString(QAbstractSocket::tr("Connection refused")); } emit q->stateChanged(state); - emit q->error(socketError); + emit q->errorOccurred(socketError); return; } @@ -1223,7 +1232,7 @@ void QAbstractSocketPrivate::_q_abortConnectionAttempt() setError(QAbstractSocket::SocketTimeoutError, QAbstractSocket::tr("Connection timed out")); emit q->stateChanged(state); - emit q->error(socketError); + emit q->errorOccurred(socketError); } else { _q_connectToNextAddress(); } @@ -1430,14 +1439,14 @@ void QAbstractSocketPrivate::setError(QAbstractSocket::SocketError errorCode, \internal Sets the socket error state to \c errorCode and \a errorString, - and emits the QAbstractSocket::error() signal. + and emits the QAbstractSocket::errorOccurred() signal. */ void QAbstractSocketPrivate::setErrorAndEmit(QAbstractSocket::SocketError errorCode, const QString &errorString) { Q_Q(QAbstractSocket); setError(errorCode, errorString); - emit q->error(errorCode); + emit q->errorOccurred(errorCode); } /*! \internal @@ -1456,6 +1465,9 @@ QAbstractSocket::QAbstractSocket(SocketType socketType, : socketType == SctpSocket ? "Sctp" : "Unknown", &dd, parent); #endif d->socketType = socketType; + + // Support the deprecated error() signal: + connect(this, &QAbstractSocket::errorOccurred, this, QOverload::of(&QAbstractSocket::error)); } /*! @@ -1654,7 +1666,7 @@ bool QAbstractSocket::isValid() const established, QAbstractSocket enters ConnectedState and emits connected(). - At any point, the socket can emit error() to signal that an error + At any point, the socket can emit errorOccurred() to signal that an error occurred. \a hostName may be an IP address in string form (e.g., diff --git a/src/network/socket/qabstractsocket.h b/src/network/socket/qabstractsocket.h index de09195eeb1..1482dcaab24 100644 --- a/src/network/socket/qabstractsocket.h +++ b/src/network/socket/qabstractsocket.h @@ -206,7 +206,11 @@ Q_SIGNALS: void connected(); void disconnected(); void stateChanged(QAbstractSocket::SocketState); +#if QT_DEPRECATED_SINCE(5,15) + QT_DEPRECATED_X("Use QAbstractSocket::errorOccurred(QAbstractSocket::SocketError) instead") void error(QAbstractSocket::SocketError); +#endif + void errorOccurred(QAbstractSocket::SocketError); #ifndef QT_NO_NETWORKPROXY void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator); #endif diff --git a/src/network/socket/qhttpsocketengine.cpp b/src/network/socket/qhttpsocketengine.cpp index bce0da4ae42..9de9b284c1b 100644 --- a/src/network/socket/qhttpsocketengine.cpp +++ b/src/network/socket/qhttpsocketengine.cpp @@ -93,7 +93,7 @@ bool QHttpSocketEngine::initialize(QAbstractSocket::SocketType type, QAbstractSo connect(d->socket, SIGNAL(bytesWritten(qint64)), this, SLOT(slotSocketBytesWritten()), Qt::DirectConnection); - connect(d->socket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(d->socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(slotSocketError(QAbstractSocket::SocketError)), Qt::DirectConnection); connect(d->socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), diff --git a/src/network/socket/qlocalsocket.h b/src/network/socket/qlocalsocket.h index ae78c86b3c5..9cd62abca64 100644 --- a/src/network/socket/qlocalsocket.h +++ b/src/network/socket/qlocalsocket.h @@ -132,14 +132,14 @@ private: Q_DISABLE_COPY(QLocalSocket) #if defined(QT_LOCALSOCKET_TCP) Q_PRIVATE_SLOT(d_func(), void _q_stateChanged(QAbstractSocket::SocketState)) - Q_PRIVATE_SLOT(d_func(), void _q_error(QAbstractSocket::SocketError)) + Q_PRIVATE_SLOT(d_func(), void _q_errorOccurred(QAbstractSocket::SocketError)) #elif defined(Q_OS_WIN) Q_PRIVATE_SLOT(d_func(), void _q_canWrite()) Q_PRIVATE_SLOT(d_func(), void _q_pipeClosed()) Q_PRIVATE_SLOT(d_func(), void _q_winError(ulong, const QString &)) #else Q_PRIVATE_SLOT(d_func(), void _q_stateChanged(QAbstractSocket::SocketState)) - Q_PRIVATE_SLOT(d_func(), void _q_error(QAbstractSocket::SocketError)) + Q_PRIVATE_SLOT(d_func(), void _q_errorOccurred(QAbstractSocket::SocketError)) Q_PRIVATE_SLOT(d_func(), void _q_connectToSocket()) Q_PRIVATE_SLOT(d_func(), void _q_abortConnectionAttempt()) #endif diff --git a/src/network/socket/qlocalsocket_p.h b/src/network/socket/qlocalsocket_p.h index e3bcd923263..0e05e4c5d75 100644 --- a/src/network/socket/qlocalsocket_p.h +++ b/src/network/socket/qlocalsocket_p.h @@ -127,7 +127,7 @@ public: QString generateErrorString(QLocalSocket::LocalSocketError, const QString &function) const; void setErrorAndEmit(QLocalSocket::LocalSocketError, const QString &function); void _q_stateChanged(QAbstractSocket::SocketState newState); - void _q_error(QAbstractSocket::SocketError newError); + void _q_errorOccurred(QAbstractSocket::SocketError newError); #elif defined(Q_OS_WIN) ~QLocalSocketPrivate(); void destroyPipeHandles(); @@ -144,7 +144,7 @@ public: QString generateErrorString(QLocalSocket::LocalSocketError, const QString &function) const; void setErrorAndEmit(QLocalSocket::LocalSocketError, const QString &function); void _q_stateChanged(QAbstractSocket::SocketState newState); - void _q_error(QAbstractSocket::SocketError newError); + void _q_errorOccurred(QAbstractSocket::SocketError newError); void _q_connectToSocket(); void _q_abortConnectionAttempt(); void cancelDelayedConnect(); diff --git a/src/network/socket/qlocalsocket_tcp.cpp b/src/network/socket/qlocalsocket_tcp.cpp index e13bcfc0cb9..1c63d161874 100644 --- a/src/network/socket/qlocalsocket_tcp.cpp +++ b/src/network/socket/qlocalsocket_tcp.cpp @@ -77,8 +77,8 @@ void QLocalSocketPrivate::setSocket(QLocalUnixSocket* socket) q->connect(tcpSocket, SIGNAL(disconnected()), q, SIGNAL(disconnected())); q->connect(tcpSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), q, SLOT(_q_stateChanged(QAbstractSocket::SocketState))); - q->connect(tcpSocket, SIGNAL(error(QAbstractSocket::SocketError)), - q, SLOT(_q_error(QAbstractSocket::SocketError))); + q->connect(tcpSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), + q, SLOT(_q_errorOccurred(QAbstractSocket::SocketError))); q->connect(tcpSocket, SIGNAL(readChannelFinished()), q, SIGNAL(readChannelFinished())); tcpSocket->setParent(q); } @@ -88,7 +88,7 @@ qint64 QLocalSocketPrivate::skip(qint64 maxSize) return tcpSocket->skip(maxSize); } -void QLocalSocketPrivate::_q_error(QAbstractSocket::SocketError socketError) +void QLocalSocketPrivate::_q_errorOccurred(QAbstractSocket::SocketError socketError) { Q_Q(QLocalSocket); QString function = QLatin1String("QLocalSocket"); diff --git a/src/network/socket/qlocalsocket_unix.cpp b/src/network/socket/qlocalsocket_unix.cpp index 5e1da78c942..d9b39a7752f 100644 --- a/src/network/socket/qlocalsocket_unix.cpp +++ b/src/network/socket/qlocalsocket_unix.cpp @@ -81,8 +81,8 @@ void QLocalSocketPrivate::init() q->connect(&unixSocket, SIGNAL(disconnected()), q, SIGNAL(disconnected())); q->connect(&unixSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), q, SLOT(_q_stateChanged(QAbstractSocket::SocketState))); - q->connect(&unixSocket, SIGNAL(error(QAbstractSocket::SocketError)), - q, SLOT(_q_error(QAbstractSocket::SocketError))); + q->connect(&unixSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), + q, SLOT(_q_errorOccurred(QAbstractSocket::SocketError))); q->connect(&unixSocket, SIGNAL(readChannelFinished()), q, SIGNAL(readChannelFinished())); unixSocket.setParent(q); } @@ -92,7 +92,7 @@ qint64 QLocalSocketPrivate::skip(qint64 maxSize) return unixSocket.skip(maxSize); } -void QLocalSocketPrivate::_q_error(QAbstractSocket::SocketError socketError) +void QLocalSocketPrivate::_q_errorOccurred(QAbstractSocket::SocketError socketError) { Q_Q(QLocalSocket); QString function = QLatin1String("QLocalSocket"); diff --git a/src/network/socket/qsocks5socketengine.cpp b/src/network/socket/qsocks5socketengine.cpp index 0530a1af30c..4f866e4da00 100644 --- a/src/network/socket/qsocks5socketengine.cpp +++ b/src/network/socket/qsocks5socketengine.cpp @@ -559,8 +559,8 @@ void QSocks5SocketEnginePrivate::initialize(Socks5Mode socks5Mode) Qt::DirectConnection); QObject::connect(data->controlSocket, SIGNAL(bytesWritten(qint64)), q, SLOT(_q_controlSocketBytesWritten()), Qt::DirectConnection); - QObject::connect(data->controlSocket, SIGNAL(error(QAbstractSocket::SocketError)), - q, SLOT(_q_controlSocketError(QAbstractSocket::SocketError)), + QObject::connect(data->controlSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), + q, SLOT(_q_controlSocketErrorOccurred(QAbstractSocket::SocketError)), Qt::DirectConnection); QObject::connect(data->controlSocket, SIGNAL(disconnected()), q, SLOT(_q_controlSocketDisconnected()), Qt::DirectConnection); @@ -1056,7 +1056,7 @@ bool QSocks5SocketEngine::initialize(qintptr socketDescriptor, QAbstractSocket:: Qt::DirectConnection); QObject::connect(d->data->controlSocket, SIGNAL(bytesWritten(qint64)), this, SLOT(_q_controlSocketBytesWritten()), Qt::DirectConnection); - QObject::connect(d->data->controlSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(_q_controlSocketError(QAbstractSocket::SocketError)), + QObject::connect(d->data->controlSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(_q_controlSocketErrorOccurred(QAbstractSocket::SocketError)), Qt::DirectConnection); QObject::connect(d->data->controlSocket, SIGNAL(disconnected()), this, SLOT(_q_controlSocketDisconnected()), Qt::DirectConnection); @@ -1231,7 +1231,7 @@ void QSocks5SocketEnginePrivate::_q_controlSocketBytesWritten() } } -void QSocks5SocketEnginePrivate::_q_controlSocketError(QAbstractSocket::SocketError error) +void QSocks5SocketEnginePrivate::_q_controlSocketErrorOccurred(QAbstractSocket::SocketError error) { QSOCKS5_D_DEBUG << "controlSocketError" << error << data->controlSocket->errorString(); diff --git a/src/network/socket/qsocks5socketengine_p.h b/src/network/socket/qsocks5socketengine_p.h index c256987e2de..77b461b9441 100644 --- a/src/network/socket/qsocks5socketengine_p.h +++ b/src/network/socket/qsocks5socketengine_p.h @@ -130,7 +130,7 @@ private: Q_DISABLE_COPY_MOVE(QSocks5SocketEngine) Q_PRIVATE_SLOT(d_func(), void _q_controlSocketConnected()) Q_PRIVATE_SLOT(d_func(), void _q_controlSocketReadNotification()) - Q_PRIVATE_SLOT(d_func(), void _q_controlSocketError(QAbstractSocket::SocketError)) + Q_PRIVATE_SLOT(d_func(), void _q_controlSocketErrorOccurred(QAbstractSocket::SocketError)) #ifndef QT_NO_UDPSOCKET Q_PRIVATE_SLOT(d_func(), void _q_udpSocketReadNotification()) #endif @@ -246,7 +246,7 @@ public: void _q_controlSocketConnected(); void _q_controlSocketReadNotification(); - void _q_controlSocketError(QAbstractSocket::SocketError); + void _q_controlSocketErrorOccurred(QAbstractSocket::SocketError); #ifndef QT_NO_UDPSOCKET void _q_udpSocketReadNotification(); #endif diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 775b6227ed1..912b30b29bb 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -2535,7 +2535,7 @@ void QSslSocketPrivate::createPlainSocket(QIODevice::OpenMode openMode) q->connect(plainSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), q, SLOT(_q_stateChangedSlot(QAbstractSocket::SocketState)), Qt::DirectConnection); - q->connect(plainSocket, SIGNAL(error(QAbstractSocket::SocketError)), + q->connect(plainSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), q, SLOT(_q_errorSlot(QAbstractSocket::SocketError)), Qt::DirectConnection); q->connect(plainSocket, SIGNAL(readyRead()), diff --git a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp index 771a4d0a32c..60018298543 100644 --- a/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp +++ b/tests/auto/gui/image/qimagereader/tst_qimagereader.cpp @@ -1081,7 +1081,7 @@ private slots: void acceptNewConnection() { serverSocket = server.nextPendingConnection(); - connect(serverSocket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(serverSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(remoteHostClosed())); } diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index b1588d4120b..5a97d8a9b94 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -674,7 +674,7 @@ private: //qDebug() << "connectSocketSignals" << client; connect(client.data(), SIGNAL(readyRead()), this, SLOT(readyReadSlot())); connect(client.data(), SIGNAL(bytesWritten(qint64)), this, SLOT(bytesWrittenSlot())); - connect(client.data(), SIGNAL(error(QAbstractSocket::SocketError)), + connect(client.data(), SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(slotError(QAbstractSocket::SocketError))); } diff --git a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp index 7644a063801..2d0d9f5ffc1 100644 --- a/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp +++ b/tests/auto/network/socket/qhttpsocketengine/tst_qhttpsocketengine.cpp @@ -270,7 +270,7 @@ void tst_QHttpSocketEngine::errorTest() socket.setProxy(QNetworkProxy(QNetworkProxy::HttpProxy, hostname, port, username, username)); socket.connectToHost("0.1.2.3", 12345); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(30); QVERIFY(!QTestEventLoop::instance().timeout()); diff --git a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp index 44b5a02af41..85eec6e783b 100644 --- a/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp +++ b/tests/auto/network/socket/qsocks5socketengine/tst_qsocks5socketengine.cpp @@ -283,7 +283,7 @@ void tst_QSocks5SocketEngine::errorTest() socket.setProxy(QNetworkProxy(QNetworkProxy::Socks5Proxy, hostname, port, username, username)); socket.connectToHost("0.1.2.3", 12345); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(10); QVERIFY(!QTestEventLoop::instance().timeout()); @@ -753,7 +753,7 @@ void tst_QSocks5SocketEngine::downloadBigFile() QTestEventLoop::instance().exitLoop(); }); - connect(&socket, QOverload::of(&QAbstractSocket::error), + connect(&socket, &QAbstractSocket::errorOccurred, [&socket, &stopWatch] (QAbstractSocket::SocketError errorCode) { qWarning().noquote().nospace() << QTest::currentTestFunction() @@ -1006,7 +1006,7 @@ void tst_QSocks5SocketEngine::incomplete() connect(&socket, SIGNAL(connected()), &QTestEventLoop::instance(), SLOT(exitLoop())); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(70); QVERIFY(!QTestEventLoop::instance().timeout()); diff --git a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp index f85d041f49b..6dd390ccbd6 100644 --- a/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp +++ b/tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp @@ -2019,14 +2019,14 @@ void tst_QTcpSocket::remoteCloseError() QCOMPARE(clientSocket->bytesAvailable(), qint64(5)); qRegisterMetaType("QAbstractSocket::SocketError"); - QSignalSpy errorSpy(clientSocket, SIGNAL(error(QAbstractSocket::SocketError))); + QSignalSpy errorSpy(clientSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); QSignalSpy disconnectedSpy(clientSocket, SIGNAL(disconnected())); clientSocket->write("World"); serverSocket->disconnectFromHost(); tmpSocket = clientSocket; - connect(clientSocket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(clientSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(remoteCloseErrorSlot())); enterLoop(30); @@ -2079,7 +2079,7 @@ void tst_QTcpSocket::nestedEventLoopInErrorSlot() { QTcpSocket *socket = newSocket(); QPointer p(socket); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(enterLoopSlot())); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(enterLoopSlot())); socket->connectToHost("hostnotfoundhostnotfound.qt-project.org", 9999); enterLoop(30); @@ -2109,7 +2109,7 @@ void tst_QTcpSocket::connectToHostError() QFETCH(int, port); QFETCH(QAbstractSocket::SocketError, expectedError); - connect(socket, QOverload::of(&QAbstractSocket::error),[&](QAbstractSocket::SocketError socketError){ + connect(socket, &QAbstractSocket::errorOccurred, [&](QAbstractSocket::SocketError socketError){ error = socketError; }); socket->connectToHost(host, port); // no service running here, one suspects @@ -2326,7 +2326,7 @@ void tst_QTcpSocket::abortiveClose() qRegisterMetaType("QAbstractSocket::SocketError"); QSignalSpy readyReadSpy(clientSocket, SIGNAL(readyRead())); - QSignalSpy errorSpy(clientSocket, SIGNAL(error(QAbstractSocket::SocketError))); + QSignalSpy errorSpy(clientSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); connect(clientSocket, SIGNAL(disconnected()), this, SLOT(exitLoopSlot())); QTimer::singleShot(0, this, SLOT(abortiveClose_abortSlot())); @@ -2439,14 +2439,14 @@ void tst_QTcpSocket::connectionRefused() QTcpSocket *socket = newSocket(); QSignalSpy stateSpy(socket, SIGNAL(stateChanged(QAbstractSocket::SocketState))); - QSignalSpy errorSpy(socket, SIGNAL(error(QAbstractSocket::SocketError))); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), + QSignalSpy errorSpy(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); socket->connectToHost(QtNetworkSettings::httpServerName(), 144); enterLoop(10); - disconnect(socket, SIGNAL(error(QAbstractSocket::SocketError)), + disconnect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); QVERIFY2(!timeout(), "Network timeout"); @@ -2773,7 +2773,7 @@ void tst_QTcpSocket::taskQtBug5799ConnectionErrorEventLoop() // check that we get a proper error connecting to port 12346 // This testcase uses an event loop QTcpSocket socket; - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); socket.connectToHost(QtNetworkSettings::httpServerName(), 12346); QTestEventLoop::instance().enterLoop(10); @@ -3209,7 +3209,7 @@ void tst_QTcpSocket::readNotificationsAfterBind() QAbstractSocket socket(QAbstractSocket::TcpSocket, nullptr); QVERIFY2(socket.bind(), "Bind error!"); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); QSignalSpy spyReadyRead(&socket, SIGNAL(readyRead())); socket.connectToHost(QtNetworkSettings::serverName(), 12346); diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 0f419e9de49..cc41260d598 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -883,7 +883,7 @@ void tst_QUdpSocket::writeDatagram() qRegisterMetaType("QAbstractSocket::SocketError"); for(int i=0;;i++) { - QSignalSpy errorspy(&client, SIGNAL(error(QAbstractSocket::SocketError))); + QSignalSpy errorspy(&client, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); QSignalSpy bytesspy(&client, SIGNAL(bytesWritten(qint64))); qint64 written = client.writeDatagram(QByteArray(i * 1024, 'w'), serverAddress, @@ -1044,7 +1044,7 @@ void tst_QUdpSocket::writeToNonExistingPeer() QUdpSocket sConnected; QSignalSpy sConnectedReadyReadSpy(&sConnected, SIGNAL(readyRead())); - QSignalSpy sConnectedErrorSpy(&sConnected, SIGNAL(error(QAbstractSocket::SocketError))); + QSignalSpy sConnectedErrorSpy(&sConnected, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); sConnected.connectToHost(peerAddress, peerPort, QIODevice::ReadWrite); QVERIFY(sConnected.waitForConnected(10000)); diff --git a/tests/auto/network/ssl/qocsp/tst_qocsp.cpp b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp index c1072303164..edd1c245478 100644 --- a/tests/auto/network/ssl/qocsp/tst_qocsp.cpp +++ b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp @@ -410,7 +410,7 @@ private: static QString certDirPath; - void (QSslSocket::*socketErrorSignal)(QAbstractSocket::SocketError) = &QAbstractSocket::error; + void (QSslSocket::*socketErrorSignal)(QAbstractSocket::SocketError) = &QAbstractSocket::errorOccurred; void (QSslSocket::*tlsErrorsSignal)(const QList &) = &QSslSocket::sslErrors; void (QTestEventLoop::*exitLoopSlot)() = &QTestEventLoop::exitLoop; diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index cf383afd8bd..23495436eb6 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1240,7 +1240,7 @@ protected: configuration.setProtocol(protocol); if (ignoreSslErrors) connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SIGNAL(socketError(QAbstractSocket::SocketError))); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SIGNAL(socketError(QAbstractSocket::SocketError))); QFile file(m_keyFile); QVERIFY(file.open(QIODevice::ReadOnly)); @@ -1377,8 +1377,8 @@ void tst_QSslSocket::protocolServerSide() socket = &client; QFETCH(QSsl::SslProtocol, clientProtocol); socket->setProtocol(clientProtocol); - // upon SSL wrong version error, error will be triggered, not sslErrors - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + // upon SSL wrong version error, errorOccurred will be triggered, not sslErrors + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -1438,8 +1438,8 @@ void tst_QSslSocket::serverCipherPreferences() sslConfig.setCiphers({QSslCipher("AES256-SHA"), QSslCipher("AES128-SHA")}); socket->setSslConfiguration(sslConfig); - // upon SSL wrong version error, error will be triggered, not sslErrors - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + // upon SSL wrong version error, errorOccurred will be triggered, not sslErrors + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -1470,8 +1470,8 @@ void tst_QSslSocket::serverCipherPreferences() sslConfig.setCiphers({QSslCipher("AES256-SHA"), QSslCipher("AES128-SHA")}); socket->setSslConfiguration(sslConfig); - // upon SSL wrong version error, error will be triggered, not sslErrors - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + // upon SSL wrong version error, errorOccurred will be triggered, not sslErrors + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -1561,7 +1561,7 @@ void tst_QSslSocket::setLocalCertificateChain() const QScopedPointer client(new QSslSocket); socket = client.data(); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); socket->connectToHostEncrypted(QHostAddress(QHostAddress::LocalHost).toString(), server.serverPort()); @@ -2551,8 +2551,8 @@ void tst_QSslSocket::closeWhileEmittingSocketError() clientConfig.setPeerVerifyMode(QSslSocket::VerifyNone); clientSocket.setSslConfiguration(clientConfig); - QSignalSpy socketErrorSpy(&clientSocket, SIGNAL(error(QAbstractSocket::SocketError))); - void (QSslSocket::*errorSignal)(QAbstractSocket::SocketError) = &QSslSocket::error; + QSignalSpy socketErrorSpy(&clientSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); + void (QSslSocket::*errorSignal)(QAbstractSocket::SocketError) = &QSslSocket::errorOccurred; connect(&clientSocket, errorSignal, &handshake, &BrokenPskHandshake::socketError); clientSocket.connectToHostEncrypted(QStringLiteral("127.0.0.1"), handshake.serverPort()); @@ -2652,7 +2652,7 @@ void tst_QSslSocket::ignoreSslErrorsList() socket.ignoreSslErrors(expectedSslErrors); QFETCH(int, expectedSslErrorSignalCount); - QSignalSpy sslErrorsSpy(&socket, SIGNAL(error(QAbstractSocket::SocketError))); + QSignalSpy sslErrorsSpy(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); socket.connectToHostEncrypted(QtNetworkSettings::httpServerName(), 443); @@ -2946,13 +2946,13 @@ void tst_QSslSocket::resume() QSignalSpy sslErrorSpy(&socket, SIGNAL(sslErrors(QList))); QSignalSpy encryptedSpy(&socket, SIGNAL(encrypted())); - QSignalSpy errorSpy(&socket, SIGNAL(error(QAbstractSocket::SocketError))); + QSignalSpy errorSpy(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); connect(&socket, SIGNAL(sslErrors(QList)), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(&socket, SIGNAL(encrypted()), &QTestEventLoop::instance(), SLOT(exitLoop())); connect(&socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &QTestEventLoop::instance(), SLOT(exitLoop())); socket.connectToHostEncrypted(QtNetworkSettings::imapServerName(), 993); QTestEventLoop::instance().enterLoop(10); @@ -3263,7 +3263,7 @@ void tst_QSslSocket::dhServer() QSslSocket client; socket = &client; - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -3297,7 +3297,7 @@ void tst_QSslSocket::dhServerCustomParamsNull() QSslSocket client; socket = &client; - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -3342,7 +3342,7 @@ void tst_QSslSocket::dhServerCustomParams() QSslSocket client; socket = &client; - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -3377,7 +3377,7 @@ void tst_QSslSocket::ecdhServer() QSslSocket client; socket = &client; - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -3569,7 +3569,7 @@ void tst_QSslSocket::readBufferMaxSize() QSslSocketPtr client(new QSslSocket); socket = client.data(); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), &loop, SLOT(quit())); + connect(socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), &loop, SLOT(quit())); connect(socket, SIGNAL(sslErrors(QList)), this, SLOT(ignoreErrorSlot())); connect(socket, SIGNAL(encrypted()), &loop, SLOT(quit())); @@ -3830,7 +3830,7 @@ void tst_QSslSocket::simplePskConnect() QSignalSpy sslErrorsSpy(&socket, SIGNAL(sslErrors(QList))); QVERIFY(sslErrorsSpy.isValid()); - QSignalSpy socketErrorsSpy(&socket, SIGNAL(error(QAbstractSocket::SocketError))); + QSignalSpy socketErrorsSpy(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError))); QVERIFY(socketErrorsSpy.isValid()); QSignalSpy peerVerifyErrorSpy(&socket, SIGNAL(peerVerifyError(QSslError))); @@ -3844,7 +3844,7 @@ void tst_QSslSocket::simplePskConnect() connect(&socket, SIGNAL(modeChanged(QSslSocket::SslMode)), this, SLOT(exitLoop())); connect(&socket, SIGNAL(encrypted()), this, SLOT(exitLoop())); connect(&socket, SIGNAL(sslErrors(QList)), this, SLOT(exitLoop())); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(exitLoop())); + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(exitLoop())); connect(&socket, SIGNAL(peerVerifyError(QSslError)), this, SLOT(exitLoop())); connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(exitLoop())); @@ -4112,7 +4112,7 @@ void tst_QSslSocket::pskServer() connect(&socket, SIGNAL(modeChanged(QSslSocket::SslMode)), this, SLOT(exitLoop())); connect(&socket, SIGNAL(encrypted()), this, SLOT(exitLoop())); connect(&socket, SIGNAL(sslErrors(QList)), this, SLOT(exitLoop())); - connect(&socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(exitLoop())); + connect(&socket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(exitLoop())); connect(&socket, SIGNAL(peerVerifyError(QSslError)), this, SLOT(exitLoop())); connect(&socket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(exitLoop())); @@ -4292,7 +4292,7 @@ void tst_QSslSocket::signatureAlgorithm() QEventLoop loop; QTimer::singleShot(5000, &loop, &QEventLoop::quit); - connect(socket, QOverload::of(&QAbstractSocket::error), &loop, &QEventLoop::quit); + connect(socket, &QAbstractSocket::errorOccurred, &loop, &QEventLoop::quit); connect(socket, QOverload &>::of(&QSslSocket::sslErrors), this, &tst_QSslSocket::ignoreErrorSlot); connect(socket, &QSslSocket::encrypted, &loop, &QEventLoop::quit); diff --git a/tests/manual/bearerex/datatransferer.cpp b/tests/manual/bearerex/datatransferer.cpp index 0eeeb090ae0..b4409ce52cd 100644 --- a/tests/manual/bearerex/datatransferer.cpp +++ b/tests/manual/bearerex/datatransferer.cpp @@ -53,7 +53,7 @@ DataTransfererQTcp::DataTransfererQTcp(QObject* parent) connect(&m_qsocket, SIGNAL(readyRead()), this, SLOT(readyRead())); connect(&m_qsocket, SIGNAL(connected()), this, SLOT(connected())); - connect(&m_qsocket, SIGNAL(error(QAbstractSocket::SocketError)), + connect(&m_qsocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)), this, SLOT(error(QAbstractSocket::SocketError))); }