forked from osmocom/wireshark
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>
This commit is contained in:
parent
416ccd18c4
commit
e84d431e39
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue