aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2020-10-10 19:56:52 +0200
committerLNJ <lnj@kaidan.im>2020-10-10 20:12:09 +0200
commita982cd02ec3e1ff37c248ea0d3c36e79f3a45ad5 (patch)
tree45c86227ae89e05f80e64a5017edd73359a91d46 /examples
parent2298886f4d75adbc351b448274b39edf54da38ee (diff)
downloadqxmpp-a982cd02ec3e1ff37c248ea0d3c36e79f3a45ad5.tar.gz
Disable foreach also in examples and tests
Diffstat (limited to 'examples')
-rw-r--r--examples/example_7_archiveHandling/example_7_archiveHandling.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/example_7_archiveHandling/example_7_archiveHandling.cpp b/examples/example_7_archiveHandling/example_7_archiveHandling.cpp
index 282ec0df..d3968fb4 100644
--- a/examples/example_7_archiveHandling/example_7_archiveHandling.cpp
+++ b/examples/example_7_archiveHandling/example_7_archiveHandling.cpp
@@ -104,7 +104,7 @@ void xmppClient::archiveListReceived(const QList<QXmppArchiveChat> &chats, const
logEnd("no items");
} else {
logEnd(QString("items %1 to %2 of %3").arg(QString::number(rsmReply.index()), QString::number(rsmReply.index() + chats.size() - 1), QString::number(rsmReply.count())));
- foreach (const QXmppArchiveChat &chat, chats) {
+ for (const auto &chat : chats) {
qDebug("chat start %s", qPrintable(chat.start().toString()));
// NOTE: to actually retrieve conversations, uncomment this
//archiveManager->retrieveCollection(chat.with(), chat.start());
@@ -127,8 +127,11 @@ void xmppClient::archiveListReceived(const QList<QXmppArchiveChat> &chats, const
void xmppClient::archiveChatReceived(const QXmppArchiveChat &chat, const QXmppResultSetReply &rsmReply)
{
- logEnd(QString("chat received, RSM count %1").arg(QString::number(rsmReply.count())));
- foreach (const QXmppArchiveMessage &msg, chat.messages()) {
+ logEnd(QString("chat received, RSM count %1")
+ .arg(QString::number(rsmReply.count())));
+
+ const auto messages = chat.messages();
+ for (const auto &msg : messages) {
qDebug("example_7_archiveHandling : %s", qPrintable(msg.body()));
}
}