Ref T730, directly use context from sApp

* using sApp->getIContextOwnAircraft()
* no need to pass context, avoid issues when shutting down
* minor style changes
This commit is contained in:
Klaus Basan
2019-09-21 15:17:24 +02:00
committed by Mat Sutcliffe
parent 99edc9cb13
commit 66b02e61c5
3 changed files with 73 additions and 64 deletions

View File

@@ -778,12 +778,11 @@ namespace BlackCore
void CContextAudio::xCtxNetworkConnectionStatusChanged(const CConnectionStatus &from, const CConnectionStatus &to)
{
Q_UNUSED(from);
Q_UNUSED(from)
BLACK_VERIFY_X(this->getIContextNetwork(), Q_FUNC_INFO, "Missing network context");
if (to.isConnected() && this->getIContextNetwork())
{
CUser connectedUser = this->getIContextNetwork()->getConnectedServer().getUser();
m_voiceClient.setContextOwnAircraft(getIContextOwnAircraft());
const CUser connectedUser = this->getIContextNetwork()->getConnectedServer().getUser();
m_voiceClient.connectTo(connectedUser.getId(), connectedUser.getPassword(), connectedUser.getCallsign().asString());
m_voiceClient.start(QAudioDeviceInfo::defaultInputDevice(), QAudioDeviceInfo::defaultOutputDevice(), {0, 1});
}