mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +08:00
Style
This commit is contained in:
@@ -138,31 +138,33 @@ namespace BlackCore
|
|||||||
QMutexLocker lock(&m_mutexConnection);
|
QMutexLocker lock(&m_mutexConnection);
|
||||||
|
|
||||||
// async connection
|
// async connection
|
||||||
m_connection->connectTo(cid, password, callsign, client, { this, [ = ](bool authenticated)
|
m_connection->connectTo(cid, password, callsign, client,
|
||||||
{
|
{
|
||||||
// this is the callback when the connection has been established
|
this, [ = ](bool authenticated)
|
||||||
|
|
||||||
const QVector<StationDto> aliasedStations = m_connection->getAllAliasedStations();
|
|
||||||
this->setAliasedStations(aliasedStations); // threadsafe
|
|
||||||
this->onTimerUpdate();
|
|
||||||
|
|
||||||
// const bool isConnected = this->isConnected(); // threadsafe
|
|
||||||
if (authenticated)
|
|
||||||
{
|
{
|
||||||
// restart timer, normally it should be started already, paranoia
|
// this is the callback when the connection has been established
|
||||||
// as I run in "my thread" starting timer should be OK
|
|
||||||
|
const QVector<StationDto> aliasedStations = m_connection->getAllAliasedStations();
|
||||||
|
this->setAliasedStations(aliasedStations); // threadsafe
|
||||||
|
this->onTimerUpdate();
|
||||||
|
|
||||||
|
// const bool isConnected = this->isConnected(); // threadsafe
|
||||||
|
if (authenticated)
|
||||||
{
|
{
|
||||||
QMutexLocker lock(&m_mutex);
|
// restart timer, normally it should be started already, paranoia
|
||||||
if (m_voiceServerTimer) { m_voiceServerTimer->start(PositionUpdatesMs); }
|
// as I run in "my thread" starting timer should be OK
|
||||||
|
{
|
||||||
|
QMutexLocker lock(&m_mutex);
|
||||||
|
if (m_voiceServerTimer) { m_voiceServerTimer->start(PositionUpdatesMs); }
|
||||||
|
}
|
||||||
|
emit this->connectionStatusChanged(Connected);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
emit this->connectionStatusChanged(Disconnected);
|
||||||
}
|
}
|
||||||
emit this->connectionStatusChanged(Connected);
|
|
||||||
}
|
}
|
||||||
else
|
});
|
||||||
{
|
|
||||||
emit this->connectionStatusChanged(Disconnected);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +300,6 @@ namespace BlackCore
|
|||||||
this->setReceiveAudio(false); // threadsafe
|
this->setReceiveAudio(false); // threadsafe
|
||||||
|
|
||||||
// stop input/output
|
// stop input/output
|
||||||
|
|
||||||
{
|
{
|
||||||
QMutexLocker lock{&m_mutex};
|
QMutexLocker lock{&m_mutex};
|
||||||
m_input->stop();
|
m_input->stop();
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ namespace BlackCore
|
|||||||
request.setRawHeader(QByteArray("swift-extrainfo"), eInfo);
|
request.setRawHeader(QByteArray("swift-extrainfo"), eInfo);
|
||||||
const int logId = m_writeLog.addPendingUrl(url);
|
const int logId = m_writeLog.addPendingUrl(url);
|
||||||
m_pendingModelPublishReply = sApp->postToNetwork(request, logId, multiPart, { this, &CDatabaseWriter::postedModelsResponse});
|
m_pendingModelPublishReply = sApp->postToNetwork(request, logId, multiPart, { this, &CDatabaseWriter::postedModelsResponse});
|
||||||
m_modelReplyPendingSince = QDateTime::currentMSecsSinceEpoch();
|
m_modelReplyPendingSince = QDateTime::currentMSecsSinceEpoch();
|
||||||
return msgs;
|
return msgs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ namespace BlackMisc
|
|||||||
return pDir;
|
return pDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString &CDirectoryUtils::audioPluginDirectory()
|
||||||
|
{
|
||||||
|
static const QString pDir(CFileUtils::appendFilePaths(binDirectory(), "audio"));
|
||||||
|
return pDir;
|
||||||
|
}
|
||||||
|
|
||||||
const QString &CDirectoryUtils::getXSwiftBusBuildDirectory()
|
const QString &CDirectoryUtils::getXSwiftBusBuildDirectory()
|
||||||
{
|
{
|
||||||
if (!CBuildConfig::isLocalDeveloperDebugBuild())
|
if (!CBuildConfig::isLocalDeveloperDebugBuild())
|
||||||
|
|||||||
@@ -43,6 +43,10 @@ namespace BlackMisc
|
|||||||
//! Plugins directory
|
//! Plugins directory
|
||||||
static const QString &pluginsDirectory();
|
static const QString &pluginsDirectory();
|
||||||
|
|
||||||
|
//! Audio plugins directory for Qt audio
|
||||||
|
//! \remark contains the audio plugins
|
||||||
|
static const QString &audioPluginDirectory();
|
||||||
|
|
||||||
//! The build directory
|
//! The build directory
|
||||||
//! \remark if is a local build
|
//! \remark if is a local build
|
||||||
static const QString &getXSwiftBusBuildDirectory();
|
static const QString &getXSwiftBusBuildDirectory();
|
||||||
|
|||||||
Reference in New Issue
Block a user