From b428f481d713ad7d522715e90ec5f6fbc964a676 Mon Sep 17 00:00:00 2001 From: Be Date: Mon, 11 Oct 2021 21:19:34 -0500 Subject: [PATCH] replace QHashIterator with QMultiHash::cbegin/cend QMultiHash is not a subclass of QHash in Qt6: https://doc.qt.io/qt-6/qtcore-changes-qt6.html#removal-of-qhash-insertmulti so the QHashIterator(const QHash &hash) constructor cannot be used with QMultiHash. --- src/preferences/dialog/dlgprefsounditem.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/preferences/dialog/dlgprefsounditem.cpp b/src/preferences/dialog/dlgprefsounditem.cpp index a1b76eae382a..29dbb51a4744 100644 --- a/src/preferences/dialog/dlgprefsounditem.cpp +++ b/src/preferences/dialog/dlgprefsounditem.cpp @@ -167,10 +167,8 @@ void DlgPrefSoundItem::channelChanged() { */ void DlgPrefSoundItem::loadPath(const SoundManagerConfig &config) { if (m_isInput) { - QMultiHash inputs(config.getInputs()); - QHashIterator it(inputs); - while (it.hasNext()) { - it.next(); + const auto inputDeviceMap = config.getInputs(); + for (auto it = inputDeviceMap.cbegin(); it != inputDeviceMap.cend(); ++it) { if (it.value().getType() == m_type && it.value().getIndex() == m_index) { setDevice(it.key()); setChannel(it.value().getChannelGroup().getChannelBase(), @@ -179,10 +177,8 @@ void DlgPrefSoundItem::loadPath(const SoundManagerConfig &config) { } } } else { - QMultiHash outputs(config.getOutputs()); - QHashIterator it(outputs); - while (it.hasNext()) { - it.next(); + const auto ouputDeviceMap = config.getOutputs(); + for (auto it = ouputDeviceMap.cbegin(); it != ouputDeviceMap.cend(); ++it) { if (it.value().getType() == m_type && it.value().getIndex() == m_index) { setDevice(it.key()); setChannel(it.value().getChannelGroup().getChannelBase(),