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/QXmppCodec.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/base/QXmppCodec.cpp') diff --git a/src/base/QXmppCodec.cpp b/src/base/QXmppCodec.cpp index 41ef12a8..2f6fb7cd 100644 --- a/src/base/QXmppCodec.cpp +++ b/src/base/QXmppCodec.cpp @@ -802,7 +802,7 @@ bool QXmppTheoraDecoder::setParameters(const QMap ¶meters) packet.granulepos = -1; packet.packetno = 0; - foreach (int h_size, h_sizes) { + for (const auto h_size : h_sizes) { if (device->bytesAvailable() < h_size) { qWarning("Theora configuration is too small"); return false; @@ -971,7 +971,7 @@ bool QXmppTheoraEncoder::setFormat(const QXmppVideoFormat &format) stream << quint32(1); quint16 length = 0; - foreach (const QByteArray &header, headers) + for (const auto &header : headers) length += header.size(); quint8 h_count = headers.size() - 1; -- cgit v1.2.3