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()
|
\sa QNetworkAccessManager::finished(), isFinished()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void QNetworkReply::error(QNetworkReply::NetworkError code)
|
|
||||||
\obsolete
|
|
||||||
|
|
||||||
Use errorOccurred() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QNetworkReply::errorOccurred(QNetworkReply::NetworkError code)
|
\fn void QNetworkReply::errorOccurred(QNetworkReply::NetworkError code)
|
||||||
\since 5.15
|
\since 5.15
|
||||||
@ -463,8 +456,6 @@ QNetworkReply::QNetworkReply(QObject *parent)
|
|||||||
QNetworkReply::QNetworkReply(QNetworkReplyPrivate &dd, QObject *parent)
|
QNetworkReply::QNetworkReply(QNetworkReplyPrivate &dd, QObject *parent)
|
||||||
: QIODevice(dd, 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:
|
Q_SIGNALS:
|
||||||
void metaDataChanged();
|
void metaDataChanged();
|
||||||
void finished();
|
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);
|
void errorOccurred(QNetworkReply::NetworkError);
|
||||||
#if QT_CONFIG(ssl)
|
#if QT_CONFIG(ssl)
|
||||||
void encrypted();
|
void encrypted();
|
||||||
|
@ -281,7 +281,7 @@ void QNetworkReplyWasmImplPrivate::emitReplyError(QNetworkReply::NetworkError er
|
|||||||
Q_Q(QNetworkReplyWasmImpl);
|
Q_Q(QNetworkReplyWasmImpl);
|
||||||
|
|
||||||
q->setError(errorCode, errorString);
|
q->setError(errorCode, errorString);
|
||||||
emit q->error(errorCode);
|
emit q->errorOccurred(errorCode);
|
||||||
|
|
||||||
q->setFinished(true);
|
q->setFinished(true);
|
||||||
emit q->finished();
|
emit q->finished();
|
||||||
|
@ -201,13 +201,6 @@
|
|||||||
\sa connectToHost(), disconnectFromHost(), abort()
|
\sa connectToHost(), disconnectFromHost(), abort()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void QAbstractSocket::error(QAbstractSocket::SocketError socketError)
|
|
||||||
\obsolete
|
|
||||||
|
|
||||||
Use errorOccurred() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QAbstractSocket::errorOccurred(QAbstractSocket::SocketError socketError)
|
\fn void QAbstractSocket::errorOccurred(QAbstractSocket::SocketError socketError)
|
||||||
\since 5.15
|
\since 5.15
|
||||||
@ -1454,9 +1447,6 @@ QAbstractSocket::QAbstractSocket(SocketType socketType,
|
|||||||
: socketType == SctpSocket ? "Sctp" : "Unknown", &dd, parent);
|
: socketType == SctpSocket ? "Sctp" : "Unknown", &dd, parent);
|
||||||
#endif
|
#endif
|
||||||
d->socketType = socketType;
|
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 connected();
|
||||||
void disconnected();
|
void disconnected();
|
||||||
void stateChanged(QAbstractSocket::SocketState);
|
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);
|
void errorOccurred(QAbstractSocket::SocketError);
|
||||||
#ifndef QT_NO_NETWORKPROXY
|
#ifndef QT_NO_NETWORKPROXY
|
||||||
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
|
void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator);
|
||||||
|
@ -329,13 +329,6 @@ QT_BEGIN_NAMESPACE
|
|||||||
\sa connectToServer(), disconnectFromServer(), abort(), connected()
|
\sa connectToServer(), disconnectFromServer(), abort(), connected()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
|
||||||
\fn void QLocalSocket::error(QLocalSocket::LocalSocketError socketError)
|
|
||||||
\obsolete
|
|
||||||
|
|
||||||
Use errorOccurred() instead.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\fn void QLocalSocket::errorOccurred(QLocalSocket::LocalSocketError socketError)
|
\fn void QLocalSocket::errorOccurred(QLocalSocket::LocalSocketError socketError)
|
||||||
\since 5.15
|
\since 5.15
|
||||||
@ -372,9 +365,6 @@ QLocalSocket::QLocalSocket(QObject * parent)
|
|||||||
{
|
{
|
||||||
Q_D(QLocalSocket);
|
Q_D(QLocalSocket);
|
||||||
d->init();
|
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:
|
Q_SIGNALS:
|
||||||
void connected();
|
void connected();
|
||||||
void disconnected();
|
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 errorOccurred(QLocalSocket::LocalSocketError socketError);
|
||||||
void stateChanged(QLocalSocket::LocalSocketState socketState);
|
void stateChanged(QLocalSocket::LocalSocketState socketState);
|
||||||
|
|
||||||
|
@ -1903,25 +1903,6 @@ bool QSslSocket::waitForDisconnected(int msecs)
|
|||||||
return retVal;
|
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
|
\since 5.15
|
||||||
|
|
||||||
|
@ -231,9 +231,6 @@ public:
|
|||||||
bool waitForBytesWritten(int msecs = 30000) override;
|
bool waitForBytesWritten(int msecs = 30000) override;
|
||||||
bool waitForDisconnected(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;
|
QList<QSslError> sslHandshakeErrors() const;
|
||||||
|
|
||||||
static bool supportsSsl();
|
static bool supportsSsl();
|
||||||
|
@ -4450,9 +4450,6 @@ void tst_QSslSocket::oldErrorsOnSocketReuse()
|
|||||||
|
|
||||||
#if QT_CONFIG(openssl)
|
#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()
|
void tst_QSslSocket::alertMissingCertificate()
|
||||||
{
|
{
|
||||||
// In this test we want a server to abort the connection due to the failing
|
// 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);
|
server.config.setMissingCertificateIsFatal(true);
|
||||||
|
|
||||||
QSslSocket clientSocket;
|
QSslSocket clientSocket;
|
||||||
connect(&clientSocket, tlsErrorSignal, [&clientSocket](const QList<QSslError> &errors){
|
connect(&clientSocket, &QSslSocket::sslErrors, [&clientSocket](const QList<QSslError> &errors){
|
||||||
qDebug() << "ERR";
|
qDebug() << "ERR";
|
||||||
clientSocket.ignoreSslErrors(errors);
|
clientSocket.ignoreSslErrors(errors);
|
||||||
});
|
});
|
||||||
@ -4497,7 +4494,7 @@ void tst_QSslSocket::alertMissingCertificate()
|
|||||||
|
|
||||||
// Presumably, RemoteHostClosedError for the client and SslHandshakeError
|
// Presumably, RemoteHostClosedError for the client and SslHandshakeError
|
||||||
// for the server:
|
// for the server:
|
||||||
connect(&clientSocket, socketErrorSignal, earlyQuitter);
|
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
|
||||||
connect(&server, &SslServer::socketError, earlyQuitter);
|
connect(&server, &SslServer::socketError, earlyQuitter);
|
||||||
|
|
||||||
runner.enterLoopMSecs(1000);
|
runner.enterLoopMSecs(1000);
|
||||||
@ -4547,7 +4544,7 @@ void tst_QSslSocket::alertInvalidCertificate()
|
|||||||
|
|
||||||
// Presumably, RemoteHostClosedError for the server and SslHandshakeError
|
// Presumably, RemoteHostClosedError for the server and SslHandshakeError
|
||||||
// for the client:
|
// for the client:
|
||||||
connect(&clientSocket, socketErrorSignal, earlyQuitter);
|
connect(&clientSocket, &QAbstractSocket::errorOccurred, earlyQuitter);
|
||||||
connect(&server, &SslServer::socketError, earlyQuitter);
|
connect(&server, &SslServer::socketError, earlyQuitter);
|
||||||
|
|
||||||
runner.enterLoopMSecs(1000);
|
runner.enterLoopMSecs(1000);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user