From 46995fd3fd7da4d1b035f71a1279c041b2871ffd Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Mon, 26 Dec 2022 21:35:16 +0100 Subject: 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. --- src/client/QXmppRegistrationManager.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/client/QXmppRegistrationManager.cpp') diff --git a/src/client/QXmppRegistrationManager.cpp b/src/client/QXmppRegistrationManager.cpp index 71c2f39e..b4ae7510 100644 --- a/src/client/QXmppRegistrationManager.cpp +++ b/src/client/QXmppRegistrationManager.cpp @@ -183,9 +183,9 @@ bool QXmppRegistrationManager::handleStanza(const QDomElement &stanza) if (features.registerMode() == QXmppStreamFeatures::Disabled) { warning(QStringLiteral("Could not request the registration form, because the server does not advertise the register stream feature.")); client()->disconnectFromServer(); - emit registrationFailed({ QXmppStanza::Error::Cancel, - QXmppStanza::Error::FeatureNotImplemented, - QStringLiteral("The server does not advertise the register stream feature.") }); + Q_EMIT registrationFailed({ QXmppStanza::Error::Cancel, + QXmppStanza::Error::FeatureNotImplemented, + QStringLiteral("The server does not advertise the register stream feature.") }); return true; } @@ -210,11 +210,11 @@ bool QXmppRegistrationManager::handleStanza(const QDomElement &stanza) switch (iq.type()) { case QXmppIq::Result: info(QStringLiteral("Successfully registered with the service.")); - emit registrationSucceeded(); + Q_EMIT registrationSucceeded(); break; case QXmppIq::Error: warning(QStringLiteral("Registering with the service failed: ").append(iq.error().text())); - emit registrationFailed(iq.error()); + Q_EMIT registrationFailed(iq.error()); break; default: break; // should never occur @@ -230,11 +230,11 @@ bool QXmppRegistrationManager::handleStanza(const QDomElement &stanza) case QXmppIq::Result: info(QStringLiteral("Changed password successfully.")); client()->configuration().setPassword(d->newPassword); - emit passwordChanged(d->newPassword); + Q_EMIT passwordChanged(d->newPassword); break; case QXmppIq::Error: warning(QStringLiteral("Failed to change password: ").append(iq.error().text())); - emit passwordChangeFailed(iq.error()); + Q_EMIT passwordChangeFailed(iq.error()); break; default: break; // should never occur @@ -250,12 +250,12 @@ bool QXmppRegistrationManager::handleStanza(const QDomElement &stanza) switch (iq.type()) { case QXmppIq::Result: info(QStringLiteral("Account deleted successfully.")); - emit accountDeleted(); + Q_EMIT accountDeleted(); client()->disconnectFromServer(); break; case QXmppIq::Error: warning(QStringLiteral("Failed to delete account: ").append(iq.error().text())); - emit accountDeletionFailed(iq.error()); + Q_EMIT accountDeletionFailed(iq.error()); break; default: break; // should never occur @@ -267,7 +267,7 @@ bool QXmppRegistrationManager::handleStanza(const QDomElement &stanza) QXmppRegisterIq iq; iq.parse(stanza); - emit registrationFormReceived(iq); + Q_EMIT registrationFormReceived(iq); } } return false; @@ -302,6 +302,6 @@ void QXmppRegistrationManager::setSupportedByServer(bool registrationSupported) { if (d->supportedByServer != registrationSupported) { d->supportedByServer = registrationSupported; - emit supportedByServerChanged(); + Q_EMIT supportedByServerChanged(); } } -- cgit v1.2.3