From 189d93b4b8cc4f6dc34b120e42c5df800cb4055b Mon Sep 17 00:00:00 2001 From: John Thacker Date: Sun, 19 Feb 2023 13:13:06 -0500 Subject: [PATCH] Qt: Substitute for C++17 ism Replace C++17 ism from !9822 with code with the same effect that is valid earlier (cherry picked from commit 50f71efbe0955b32dfb99bb4933f6ff310b39283) --- ui/qt/models/packet_list_model.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/qt/models/packet_list_model.cpp b/ui/qt/models/packet_list_model.cpp index 483d9d3ccc..366bf647e5 100644 --- a/ui/qt/models/packet_list_model.cpp +++ b/ui/qt/models/packet_list_model.cpp @@ -340,7 +340,8 @@ void PacketListModel::addFrameComment(const QModelIndexList &indices, const QByt frame_data *fdata; if (!cap_file_) return; - foreach (const auto &index, std::as_const(indices)) { + for (qsizetype i = 0; i < indices.size(); ++i) { + const auto &index = indices.at(i); if (!index.isValid()) continue; PacketListRecord *record = static_cast(index.internalPointer()); @@ -414,7 +415,8 @@ void PacketListModel::deleteFrameComments(const QModelIndexList &indices) frame_data *fdata; if (!cap_file_) return; - foreach (const auto &index, std::as_const(indices)) { + for (qsizetype i = 0; i < indices.size(); ++i) { + const auto &index = indices.at(i); if (!index.isValid()) continue; PacketListRecord *record = static_cast(index.internalPointer());