aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppCodec.cpp
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2019-05-14 17:15:11 +0200
committerLNJ <lnj@kaidan.im>2019-10-23 18:09:17 +0200
commit4172b33b1222a586d95dbc7e69dad7a19a307ea1 (patch)
tree830008c8dd42d257c8aba3080e35813d37383eb2 /src/base/QXmppCodec.cpp
parentb34ceca75db2791f00d9fa12b8714739bd19eade (diff)
downloadqxmpp-4172b33b1222a586d95dbc7e69dad7a19a307ea1.tar.gz
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.
Diffstat (limited to 'src/base/QXmppCodec.cpp')
-rw-r--r--src/base/QXmppCodec.cpp4
1 files changed, 2 insertions, 2 deletions
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<QString, QString> &parameters)
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;