diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-12-26 21:35:16 +0100 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-12-26 22:00:07 +0100 |
| commit | 46995fd3fd7da4d1b035f71a1279c041b2871ffd (patch) | |
| tree | 788517dbefa88fc1680b05a97e84f0e1d7403815 /src/client/QXmppOutgoingClient.cpp | |
| parent | 71442ab927cd5c1c235528442fe3706f33e7ff6e (diff) | |
Disable Qt keywords completely
Previously we had the policy that no qt keywords were allowed in headers
that may be included by users. However since there was no automatic test
verifying that in some places keywords were still used.
This now disables qt keywords completely, also in tests and examples. Qt
keywords are in general no good or really good idea as they even
conflict with the standard library (`emit` at least).
In some cases in the examples I just removed the slot tag if the
functions didn't need to be slots (anymore).
Closes #503.
Diffstat (limited to 'src/client/QXmppOutgoingClient.cpp')
| -rw-r--r-- | src/client/QXmppOutgoingClient.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/client/QXmppOutgoingClient.cpp b/src/client/QXmppOutgoingClient.cpp index 271ec8b9..7d1ad6a3 100644 --- a/src/client/QXmppOutgoingClient.cpp +++ b/src/client/QXmppOutgoingClient.cpp @@ -325,7 +325,7 @@ void QXmppOutgoingClient::_q_socketDisconnected() d->redirectHost = QString(); d->redirectPort = 0; } else { - emit disconnected(); + Q_EMIT disconnected(); } } @@ -338,7 +338,7 @@ void QXmppOutgoingClient::socketSslErrors(const QList<QSslError> &errors) } // relay signal - emit sslErrors(errors); + Q_EMIT sslErrors(errors); // if configured, ignore the errors if (configuration().ignoreSslErrors()) { @@ -354,7 +354,7 @@ void QXmppOutgoingClient::socketError(QAbstractSocket::SocketError socketError) // some network error occurred during startup -> try next available SRV record server d->connectToNextDNSHost(); } else { - emit error(QXmppClient::SocketError); + Q_EMIT error(QXmppClient::SocketError); } } @@ -419,7 +419,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) // give client opportunity to handle stanza bool handled = false; - emit elementReceived(nodeRecv, handled); + Q_EMIT elementReceived(nodeRecv, handled); if (handled) { return; } @@ -535,7 +535,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) // otherwise we are done d->sessionStarted = true; - emit connected(); + Q_EMIT connected(); } else if (ns == ns_stream && nodeRecv.tagName() == "error") { // handle redirects const auto otherHost = nodeRecv.firstChildElement("see-other-host"); @@ -551,7 +551,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) } else { d->xmppStreamError = QXmppStanza::Error::UndefinedCondition; } - emit error(QXmppClient::XmppStreamError); + Q_EMIT error(QXmppClient::XmppStreamError); } else if (ns == ns_sasl) { if (!d->saslClient) { warning("SASL stanza received, but no mechanism selected"); @@ -584,7 +584,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) } else { d->xmppStreamError = QXmppStanza::Error::UndefinedCondition; } - emit error(QXmppClient::XmppStreamError); + Q_EMIT error(QXmppClient::XmppStreamError); warning("Authentication failure"); disconnectFromHost(); @@ -608,7 +608,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) d->sendStreamManagementEnable(); } else { // we are connected now - emit connected(); + Q_EMIT connected(); } } else if (QXmppBindIq::isBindIq(nodeRecv) && id == d->bindId) { QXmppBindIq bind; @@ -637,12 +637,12 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) d->sendStreamManagementEnable(); } else { // we are connected now - emit connected(); + Q_EMIT connected(); } } } else if (bind.type() == QXmppIq::Error) { d->xmppStreamError = bind.error().condition(); - emit error(QXmppClient::XmppStreamError); + Q_EMIT error(QXmppClient::XmppStreamError); warning("Resource binding error received: " + bind.error().text()); disconnectFromHost(); } @@ -657,7 +657,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) // xmpp connection made d->sessionStarted = true; - emit connected(); + Q_EMIT connected(); } else if (QXmppNonSASLAuthIq::isNonSASLAuthIq(nodeRecv)) { if (type == "result") { bool digest = !nodeRecv.firstChildElement("query").firstChildElement("digest").isNull(); @@ -707,7 +707,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) iq.setError(error); sendPacket(iq); } else { - emit iqReceived(iqPacket); + Q_EMIT iqReceived(iqPacket); } } } else if (nodeRecv.tagName() == "presence") { @@ -715,13 +715,13 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) presence.parse(nodeRecv); // emit presence - emit presenceReceived(presence); + Q_EMIT presenceReceived(presence); } else if (nodeRecv.tagName() == "message") { QXmppMessage message; message.parse(nodeRecv); // emit message - emit messageReceived(message); + Q_EMIT messageReceived(message); } } else if (QXmppStreamManagementEnabled::isStreamManagementEnabled(nodeRecv)) { QXmppStreamManagementEnabled streamManagementEnabled; @@ -735,7 +735,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) d->streamManagementEnabled = true; enableStreamManagement(true); // we are connected now - emit connected(); + Q_EMIT connected(); } else if (QXmppStreamManagementResumed::isStreamManagementResumed(nodeRecv)) { QXmppStreamManagementResumed streamManagementResumed; streamManagementResumed.parse(nodeRecv); @@ -747,7 +747,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) enableStreamManagement(false); // we are connected now // TODO: The stream was resumed. Therefore, we should not send presence information or request the roster. - emit connected(); + Q_EMIT connected(); } else if (QXmppStreamManagementFailed::isStreamManagementFailed(nodeRecv)) { if (d->isResuming) { // resuming failed. We can try to bind a resource now. @@ -767,10 +767,10 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) // otherwise we are done d->sessionStarted = true; - emit connected(); + Q_EMIT connected(); } else { // we are connected now, but stream management is disabled - emit connected(); + Q_EMIT connected(); } } } @@ -812,7 +812,7 @@ void QXmppOutgoingClient::pingTimeout() { warning("Ping timeout"); QXmppStream::disconnectFromHost(); - emit error(QXmppClient::KeepAliveError); + Q_EMIT error(QXmppClient::KeepAliveError); } bool QXmppOutgoingClient::setResumeAddress(const QString &address) |
