aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorJohn Thacker <johnthacker@gmail.com>2020-07-07 17:32:00 -0400
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2020-07-08 05:51:06 +0000
commite84d431e39b16c66fb2d98afbba8d851605cda8c (patch)
tree53e182a6c79c08643b4cdddad444ee4c0f23ed0b /ui
parent416ccd18c4be6bdadb1b72da9aa125ebfd006afd (diff)
QT: Don't use qAsConst and C+11 on QT < 5.7
Introduced QT 5.7 calls in my recent change (also C+11, which is required for QT >= 5.7). Providing an alternate code path for QT < 5.7 Change-Id: I866af35138d4691a659aee756ce9c3ce4ffb933f Reviewed-on: https://code.wireshark.org/review/37779 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/follow_stream_dialog.cpp4
-rw-r--r--ui/qt/show_packet_bytes_dialog.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/ui/qt/follow_stream_dialog.cpp b/ui/qt/follow_stream_dialog.cpp
index 62a6e03de7..a5c5a77069 100644
--- a/ui/qt/follow_stream_dialog.cpp
+++ b/ui/qt/follow_stream_dialog.cpp
@@ -161,7 +161,11 @@ void FollowStreamDialog::addCodecs(const QMap<QString, QTextCodec *> &codecMap)
// Make the combobox respect max visible items?
//ui->cbCharset->setStyleSheet("QComboBox { combobox-popup: 0;}");
ui->cbCharset->insertSeparator(ui->cbCharset->count());
+#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
for (const auto &codec : qAsConst(codecMap)) {
+#else
+ foreach (const QTextCodec *codec, codecMap) {
+#endif
// This is already in the menu and handled separately
if (codec->name() != "US-ASCII" && codec->name() != "UTF-8")
ui->cbCharset->addItem(tr(codec->name()), SHOW_CODEC);
diff --git a/ui/qt/show_packet_bytes_dialog.cpp b/ui/qt/show_packet_bytes_dialog.cpp
index 6b6d6da09b..ce800c6236 100644
--- a/ui/qt/show_packet_bytes_dialog.cpp
+++ b/ui/qt/show_packet_bytes_dialog.cpp
@@ -107,7 +107,11 @@ void ShowPacketBytesDialog::addCodecs(const QMap<QString, QTextCodec *> &codecMa
// Make the combobox respect max visible items?
//ui->cbShowAs->setStyleSheet("QComboBox { combobox-popup: 0;}");
ui->cbShowAs->insertSeparator(ui->cbShowAs->count());
+#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0)
for (const auto &codec : qAsConst(codecMap)) {
+#else
+ foreach (const QTextCodec *codec, codecMap) {
+#endif
// This is already placed in the menu and handled separately
if (codec->name() != "US-ASCII" && codec->name() != "UTF-8")
ui->cbShowAs->addItem(tr(codec->name()), ShowAsCodec);