From 9f1a51fb13bea84418316961ce7cfee7a53fb593 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Thu, 6 Sep 2018 22:07:59 +0200 Subject: [PATCH] Fix wrong QHash value lookup for voice channels in use --- src/blackcore/context/contextaudioimpl.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/blackcore/context/contextaudioimpl.cpp b/src/blackcore/context/contextaudioimpl.cpp index d64c04760..a642e429e 100644 --- a/src/blackcore/context/contextaudioimpl.cpp +++ b/src/blackcore/context/contextaudioimpl.cpp @@ -322,7 +322,7 @@ namespace BlackCore m_voiceChannelMapping.remove(BlackMisc::Aviation::CComSystem::Com1); // If the voice channel is not used by anybody else - if (!m_voiceChannelMapping.key(oldVoiceChannel)) + if (!m_voiceChannelMapping.values().contains(oldVoiceChannel)) { oldVoiceChannel->leaveVoiceRoom(); m_unusedVoiceChannels.push_back(oldVoiceChannel); @@ -337,7 +337,7 @@ namespace BlackCore { QSharedPointer newVoiceChannel = getVoiceChannelBy(newRoomCom1); newVoiceChannel->setOwnAircraftCallsign(ownCallsign); - bool inUse = m_voiceChannelMapping.key(newVoiceChannel); + bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel); m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com1, newVoiceChannel); // If the voice channel is not used by anybody else @@ -362,7 +362,7 @@ namespace BlackCore m_voiceChannelMapping.remove(BlackMisc::Aviation::CComSystem::Com2); // If the voice channel is not used by anybody else - if (!m_voiceChannelMapping.key(oldVoiceChannel)) + if (!m_voiceChannelMapping.values().contains(oldVoiceChannel)) { oldVoiceChannel->leaveVoiceRoom(); m_unusedVoiceChannels.push_back(oldVoiceChannel); @@ -377,7 +377,7 @@ namespace BlackCore { auto newVoiceChannel = getVoiceChannelBy(newRoomCom2); newVoiceChannel->setOwnAircraftCallsign(ownCallsign); - bool inUse = m_voiceChannelMapping.key(newVoiceChannel); + bool inUse = m_voiceChannelMapping.values().contains(newVoiceChannel); m_voiceChannelMapping.insert(BlackMisc::Aviation::CComSystem::Com2, newVoiceChannel); // If the voice channel is not used by anybody else