QtNetwork remove deprecated signals
Use 'errorOccurred' instead of 'error' and 'sslHandshakeErrors' instead of 'sslErrors'. Fixes: QTBUG-82605 Change-Id: I19d4845b16c7b636af7b0658d4fbbba4eef9d029 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
77a8005dcb
commit
6d6bfcb9ad
@ -363,13 +363,6 @@ QNetworkReplyPrivate::QNetworkReplyPrivate()
|
||||
\sa QNetworkAccessManager::finished(), isFinished()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QNetworkReply::error(QNetworkReply::NetworkError code)
|
||||
\obsolete
|
||||
|
||||
Use errorOccurred() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QNetworkReply::errorOccurred(QNetworkReply::NetworkError code)
|
||||
\since 5.15
|
||||
@ -463,8 +456,6 @@ QNetworkReply::QNetworkReply(QObject *parent)
|
||||
QNetworkReply::QNetworkReply(QNetworkReplyPrivate &dd, QObject *parent)
|
||||
: QIODevice(dd, parent)
|
||||
{
|
||||
// Support the deprecated error() signal:
|
||||
connect(this, &QNetworkReply::errorOccurred, this, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -156,10 +156,6 @@ public Q_SLOTS:
|
||||
Q_SIGNALS:
|
||||
void metaDataChanged();
|
||||
void finished();
|
||||
#if QT_DEPRECATED_SINCE(5,15)
|
||||
QT_DEPRECATED_NETWORK_API_5_15_X("Use QNetworkReply::errorOccurred(QNetworkReply::NetworkError) instead")
|
||||
void error(QNetworkReply::NetworkError);
|
||||
#endif
|
||||
void errorOccurred(QNetworkReply::NetworkError);
|
||||
#if QT_CONFIG(ssl)
|
||||
void encrypted();
|
||||
|
@ -281,7 +281,7 @@ void QNetworkReplyWasmImplPrivate::emitReplyError(QNetworkReply::NetworkError er
|
||||
Q_Q(QNetworkReplyWasmImpl);
|
||||
|
||||
q->setError(errorCode, errorString);
|
||||
emit q->error(errorCode);
|
||||
emit q->errorOccurred(errorCode);
|
||||
|
||||
q->setFinished(true);
|
||||
emit q->finished();
|
||||
|
@ -201,13 +201,6 @@
|
||||
\sa connectToHost(), disconnectFromHost(), abort()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QAbstractSocket::error(QAbstractSocket::SocketError socketError)
|
||||
\obsolete
|
||||
|
||||
Use errorOccurred() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QAbstractSocket::errorOccurred(QAbstractSocket::SocketError socketError)
|
||||
\since 5.15
|
||||
@ -1454,9 +1447,6 @@ 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<QAbstractSocket::SocketError>::of(&QAbstractSocket::error));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -208,10 +208,6 @@ Q_SIGNALS:
|
||||
void connected();
|
||||
void disconnected();
|
||||
void stateChanged(QAbstractSocket::SocketState);
|
||||
#if QT_DEPRECATED_SINCE(5,15)
|
||||
QT_DEPRECATED_NETWORK_API_5_15_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);
|
||||
|
@ -329,13 +329,6 @@ QT_BEGIN_NAMESPACE
|
||||
\sa connectToServer(), disconnectFromServer(), abort(), connected()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QLocalSocket::error(QLocalSocket::LocalSocketError socketError)
|
||||
\obsolete
|
||||
|
||||
Use errorOccurred() instead.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn void QLocalSocket::errorOccurred(QLocalSocket::LocalSocketError socketError)
|
||||
\since 5.15
|
||||
@ -372,9 +365,6 @@ QLocalSocket::QLocalSocket(QObject * parent)
|
||||
{
|
||||
Q_D(QLocalSocket);
|
||||
d->init();
|
||||
|
||||
// Support the deprecated error() signal:
|
||||
connect(this, &QLocalSocket::errorOccurred, this, QOverload<QLocalSocket::LocalSocketError>::of(&QLocalSocket::error));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -117,10 +117,6 @@ public:
|
||||
Q_SIGNALS:
|
||||
void connected();
|
||||
void disconnected();
|
||||
#if QT_DEPRECATED_SINCE(5,15)
|
||||
QT_DEPRECATED_NETWORK_API_5_15_X("Use QLocalSocket::errorOccurred(QLocalSocket::LocalSocketError) instead")
|
||||
void error(QLocalSocket::LocalSocketError socketError);
|
||||
#endif
|
||||
void errorOccurred(QLocalSocket::LocalSocketError socketError);
|
||||
void stateChanged(QLocalSocket::LocalSocketState socketState);
|
||||
|
||||
|
@ -1903,25 +1903,6 @@ bool QSslSocket::waitForDisconnected(int msecs)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 15)
|
||||
/*!
|
||||
\deprecated
|
||||
|
||||
Use sslHandshakeErrors() instead.
|
||||
|
||||
Returns a list of the last SSL errors that occurred. This is the
|
||||
same list as QSslSocket passes via the sslErrors() signal. If the
|
||||
connection has been encrypted with no errors, this function will
|
||||
return an empty list.
|
||||
|
||||
\sa connectToHostEncrypted(), sslHandshakeErrors()
|
||||
*/
|
||||
QList<QSslError> QSslSocket::sslErrors() const
|
||||
{
|
||||
return sslHandshakeErrors();
|
||||
}
|
||||
#endif // QT_DEPRECATED_SINCE(5, 15)
|
||||
|
||||
/*!
|
||||
\since 5.15
|
||||
|
||||
|
@ -231,9 +231,6 @@ public:
|
||||
bool waitForBytesWritten(int msecs = 30000) override;
|
||||
bool waitForDisconnected(int msecs = 30000) override;
|
||||
|
||||
#if QT_DEPRECATED_SINCE(5, 15)
|
||||
QT_DEPRECATED_X("Use sslHandshakeErrors()") QList<QSslError> sslErrors() const;
|
||||
#endif // QT_DEPRECATED_SINCE(5, 15)
|
||||
QList<QSslError> sslHandshakeErrors() const;
|
||||
|
||||
static bool supportsSsl();
|
||||
|
@ -4450,9 +4450,6 @@ void tst_QSslSocket::oldErrorsOnSocketReuse()
|
||||
|
||||
#if QT_CONFIG(openssl)
|
||||
|
||||
void (QSslSocket::*const tlsErrorSignal)(const QList<QSslError> &) = &QSslSocket::sslErrors;
|
||||
void (QAbstractSocket::*const socketErrorSignal)(QAbstractSocket::SocketError) = &QAbstractSocket::error;
|
||||
|
||||
void tst_QSslSocket::alertMissingCertificate()
|
||||
{
|
||||
// In this test we want a server to abort the connection due to the failing
|
||||
@ -4474,7 +4471,7 @@ void tst_QSslSocket::alertMissingCertificate()
|
||||
server.config.setMissingCertificateIsFatal(true);
|
||||
|
||||
QSslSocket clientSocket;
|
||||
connect(&clientSocket, tlsErrorSignal, [&clientSocket](const QList<QSslError> &errors){
|
||||
connect(&clientSocket, &QSslSocket::sslErrors, [&clientSocket](const QList<QSslError> &errors){
|
||||
qDebug() << "ERR";
|
||||
clientSocket.ignoreSslErrors(errors);
|
||||
});
|
||||
@ -4497,7 +4494,7 @@ void tst_QSslSocket::alertMissingCertificate()
|
||||
|
||||
// Presumably, RemoteHostClosedError for the client and SslHandshakeError
|
||||
// for the server:
|
||||
connect(&clientSocket, socketErrorSignal, earlyQuitter);
|
||||
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
|
||||
connect(&server, &SslServer::socketError, earlyQuitter);
|
||||
|
||||
runner.enterLoopMSecs(1000);
|
||||
@ -4547,7 +4544,7 @@ void tst_QSslSocket::alertInvalidCertificate()
|
||||
|
||||
// Presumably, RemoteHostClosedError for the server and SslHandshakeError
|
||||
// for the client:
|
||||
connect(&clientSocket, socketErrorSignal, earlyQuitter);
|
||||
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
|
||||
connect(&server, &SslServer::socketError, earlyQuitter);
|
||||
|
||||
runner.enterLoopMSecs(1000);
|
||||
|
Loading…
x
Reference in New Issue
Block a user