From 4172b33b1222a586d95dbc7e69dad7a19a307ea1 Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Tue, 14 May 2019 17:15:11 +0200 Subject: Replace Q_FOREACH (foreach) by C++11 ranged for-loops Q_FOREACH is bad and will be deprecated in the future: https://www.kdab.com/goodbye-q_foreach/ This also disables Q_FOREACH by defining QT_NO_FOREACH. --- src/base/QXmppPresence.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/base/QXmppPresence.cpp') diff --git a/src/base/QXmppPresence.cpp b/src/base/QXmppPresence.cpp index b2521eb8..b18079bb 100644 --- a/src/base/QXmppPresence.cpp +++ b/src/base/QXmppPresence.cpp @@ -192,7 +192,7 @@ void QXmppPresence::setType(QXmppPresence::Type type) d->type = type; } -/// \cond +/// \cond void QXmppPresence::parse(const QDomElement &element) { QXmppStanza::parse(element); @@ -320,7 +320,7 @@ void QXmppPresence::toXml(QXmlStreamWriter *xmlWriter) const xmlWriter->writeAttribute("xmlns", ns_muc_user); if (!d->mucItem.isNull()) d->mucItem.toXml(xmlWriter); - foreach (int code, d->mucStatusCodes) { + for (const auto code : d->mucStatusCodes) { xmlWriter->writeStartElement("status"); xmlWriter->writeAttribute("code", QString::number(code)); xmlWriter->writeEndElement(); -- cgit v1.2.3