diff options
author | Øystein Heskestad <oystein.heskestad@qt.io> | 2022-07-19 10:29:48 +0200 |
---|---|---|
committer | Øystein Heskestad <oystein.heskestad@qt.io> | 2022-08-03 15:52:27 +0200 |
commit | 55cef3a13c8377c55b2fe050751c8a05eb7f9fce (patch) | |
tree | 6c7e07633931d9fc0179dcfc9fb8cf7afebfbdc9 /src/websockets/qwebsocket_wasm_p.cpp | |
parent | 398bdb6a318270c9614a56433c273fe62a2bf908 (diff) |
Replace QWebSocket::error signal with QWebSocket::errorOccurred
The signal error(QAbstractSocket::SocketError) is deprecated because
it overloads the function error() and the naming does not match other
similar signals.
Fixes: QTBUG-101756
Change-Id: Ifbddef73ea39b03a6c72b0e09caa2031135d7687
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/websockets/qwebsocket_wasm_p.cpp')
-rw-r--r-- | src/websockets/qwebsocket_wasm_p.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/websockets/qwebsocket_wasm_p.cpp b/src/websockets/qwebsocket_wasm_p.cpp index d7f86a0..4a69ed1 100644 --- a/src/websockets/qwebsocket_wasm_p.cpp +++ b/src/websockets/qwebsocket_wasm_p.cpp @@ -80,7 +80,7 @@ qint64 QWebSocketPrivate::sendTextMessage(const QString &message) if (m_readyState == 1) { result = emscripten_websocket_send_utf8_text(m_socketContext, message.toUtf8()); if (result < 0) - emit q_func()->error(QAbstractSocket::UnknownSocketError); + emitErrorOccurred(QAbstractSocket::UnknownSocketError); } else qWarning() << "Could not send message. Websocket is not open"; @@ -96,7 +96,7 @@ qint64 QWebSocketPrivate::sendBinaryMessage(const QByteArray &data) m_socketContext, const_cast<void *>(reinterpret_cast<const void *>(data.constData())), data.size()); if (result < 0) - emit q_func()->error(QAbstractSocket::UnknownSocketError); + emitErrorOccurred(QAbstractSocket::UnknownSocketError); } else qWarning() << "Could not send message. Websocket is not open"; @@ -126,12 +126,11 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, { Q_UNUSED(mask); Q_UNUSED(options) - Q_Q(QWebSocket); emscripten_websocket_get_ready_state(m_socketContext, &m_readyState); if ((m_readyState == 1 || m_readyState == 3) && m_socketContext != 0) { - emit q->error(QAbstractSocket::OperationError); + emitErrorOccurred(QAbstractSocket::OperationError); return; } @@ -147,7 +146,7 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, || url.toString().contains(QStringLiteral("\r\n")) || (isSecureContext && url.scheme() == QStringLiteral("ws"))) { setErrorString(QWebSocket::tr("Connection refused")); - Q_EMIT q->error(QAbstractSocket::ConnectionRefusedError); + emitErrorOccurred(QAbstractSocket::ConnectionRefusedError); return; } @@ -186,7 +185,7 @@ void QWebSocketPrivate::open(const QNetworkRequest &request, if (m_socketContext <= 0) { // m_readyState might not be changed yet // error - emit q->error(QAbstractSocket::UnknownSocketError); + emitErrorOccurred(QAbstractSocket::UnknownSocketError); return; } |