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(),