More qOverload cleanups in qtbase

Task-number: QTBUG-82605
Change-Id: I1c3c14ed82911ed5483258c11e76f5dd7744fa12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
Timur Pocheptsov 2020-03-24 10:33:01 +01:00
parent 28a0f1ba79
commit 4561370661
6 changed files with 6 additions and 11 deletions

View File

@ -126,8 +126,7 @@ Client::Client(QWidget *parent)
connect(sctpSocket, &QSctpSocket::connected, this, &Client::connected);
connect(sctpSocket, &QSctpSocket::disconnected, this, &Client::disconnected);
connect(sctpSocket, &QSctpSocket::channelReadyRead, this, &Client::readDatagram);
connect(sctpSocket, QOverload<QAbstractSocket::SocketError>::of(&QSctpSocket::error),
this, &Client::displayError);
connect(sctpSocket, &QSctpSocket::errorOccurred, this, &Client::displayError);
connect(consumers[SctpChannels::Time], &Consumer::writeDatagram, this, &Client::writeDatagram);
connect(consumers[SctpChannels::Chat], &Consumer::writeDatagram, this, &Client::writeDatagram);

View File

@ -868,7 +868,7 @@ void QNetworkReply::setRequest(const QNetworkRequest &request)
Sets the error condition to be \a errorCode. The human-readable
message is set with \a errorString.
Calling setError() does not emit the error(QNetworkReply::NetworkError)
Calling setError() does not emit the errorOccurred(QNetworkReply::NetworkError)
signal.
\sa error(), errorString()

View File

@ -64,7 +64,7 @@ request.setRawHeader("User-Agent", "MyOwnBrowser 1.0");
QNetworkReply *reply = manager->get(request);
connect(reply, &QIODevice::readyRead, this, &MyClass::slotReadyRead);
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error),
connect(reply, &QNetworkReply::errorOccurred,
this, &MyClass::slotError);
connect(reply, &QNetworkReply::sslErrors,
this, &MyClass::slotSslErrors);

View File

@ -512,9 +512,7 @@ void tst_Http2::goaway()
request.setAttribute(QNetworkRequest::Http2AllowedAttribute, QVariant(true));
replies[i] = manager->get(request);
QCOMPARE(replies[i]->error(), QNetworkReply::NoError);
void (QNetworkReply::*errorSignal)(QNetworkReply::NetworkError) =
&QNetworkReply::errorOccurred;
connect(replies[i], errorSignal, this, &tst_Http2::replyFinishedWithError);
connect(replies[i], &QNetworkReply::errorOccurred, this, &tst_Http2::replyFinishedWithError);
// Since we're using self-signed certificates, ignore SSL errors:
replies[i]->ignoreSslErrors();
}

View File

@ -410,7 +410,6 @@ private:
static QString certDirPath;
void (QSslSocket::*socketErrorSignal)(QAbstractSocket::SocketError) = &QAbstractSocket::errorOccurred;
void (QSslSocket::*tlsErrorsSignal)(const QList<QSslError> &) = &QSslSocket::sslErrors;
void (QTestEventLoop::*exitLoopSlot)() = &QTestEventLoop::exitLoop;
@ -764,7 +763,7 @@ void tst_QOcsp::setupOcspClient(QSslSocket &clientSocket, const CertificateChain
clientSocket.setSslConfiguration(clientConfig);
clientSocket.setPeerVerifyName(name);
connect(&clientSocket, socketErrorSignal, &loop, exitLoopSlot);
connect(&clientSocket, &QAbstractSocket::errorOccurred, &loop, exitLoopSlot);
connect(&clientSocket, tlsErrorsSignal, &loop, exitLoopSlot);
connect(&clientSocket, &QSslSocket::encrypted, &loop, exitLoopSlot);
}

View File

@ -2552,8 +2552,7 @@ void tst_QSslSocket::closeWhileEmittingSocketError()
clientSocket.setSslConfiguration(clientConfig);
QSignalSpy socketErrorSpy(&clientSocket, SIGNAL(errorOccurred(QAbstractSocket::SocketError)));
void (QSslSocket::*errorSignal)(QAbstractSocket::SocketError) = &QSslSocket::errorOccurred;
connect(&clientSocket, errorSignal, &handshake, &BrokenPskHandshake::socketError);
connect(&clientSocket, &QSslSocket::errorOccurred, &handshake, &BrokenPskHandshake::socketError);
clientSocket.connectToHostEncrypted(QStringLiteral("127.0.0.1"), handshake.serverPort());
// Make sure we have some data buffered so that close will try to flush: