diff options
author | John Thacker <johnthacker@gmail.com> | 2023-02-19 13:13:06 -0500 |
---|---|---|
committer | John Thacker <johnthacker@gmail.com> | 2023-02-19 14:57:04 -0500 |
commit | 189d93b4b8cc4f6dc34b120e42c5df800cb4055b (patch) | |
tree | 51a701893348758e251e414eee47794d2e02b825 | |
parent | 2d4e637fefd928c8bb68c1555acc032d4bbeacba (diff) |
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)
-rw-r--r-- | ui/qt/models/packet_list_model.cpp | 6 |
1 files 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<PacketListRecord*>(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<PacketListRecord*>(index.internalPointer()); |