Formatting

This commit is contained in:
Klaus Basan
2017-06-26 02:09:38 +02:00
committed by Mathew Sutcliffe
parent d96a9a9fa2
commit d2d44085ba
6 changed files with 17 additions and 28 deletions

View File

@@ -222,7 +222,6 @@ namespace BlackCore
void CNetworkVatlib::sendInterimPositions()
{
if (!m_net) { return; }
if (isConnected())
{
CSimulatedAircraft myAircraft(getOwnAircraft());

View File

@@ -359,7 +359,7 @@ namespace BlackCore
const QString dts = updateParts.at(1).trimmed();
updateTimestampFromFile = QDateTime::fromString(dts, "yyyyMMddHHmmss");
updateTimestampFromFile.setOffsetFromUtc(0);
bool alreadyRead = (updateTimestampFromFile == this->getUpdateTimestamp());
const bool alreadyRead = (updateTimestampFromFile == this->getUpdateTimestamp());
if (alreadyRead)
{
CLogMessage(this).info("VATSIM file has same timestamp, skipped");
@@ -374,8 +374,8 @@ namespace BlackCore
const QStringList fsdServerParts = currentLine.split(':');
if (fsdServerParts.size() < 5) break;
if (!fsdServerParts.at(4).trimmed().contains('1')) break; // allowed?
QString description(fsdServerParts.at(2)); // part(3) could be added
BlackMisc::Network::CServer fsdServer(fsdServerParts.at(0), description, fsdServerParts.at(1), 6809, CUser("id", "real name", "email", "password"));
const QString description(fsdServerParts.at(2)); // part(3) could be added
const BlackMisc::Network::CServer fsdServer(fsdServerParts.at(0), description, fsdServerParts.at(1), 6809, CUser("id", "real name", "email", "password"));
fsdServers.push_back(fsdServer);
}
break;
@@ -385,7 +385,7 @@ namespace BlackCore
const QStringList voiceServerParts = currentLine.split(':');
if (voiceServerParts.size() < 3) break;
if (!voiceServerParts.at(3).trimmed().contains('1')) break; // allowed?
BlackMisc::Network::CServer voiceServer(voiceServerParts.at(1), voiceServerParts.at(2), voiceServerParts.at(0), -1, CUser());
const BlackMisc::Network::CServer voiceServer(voiceServerParts.at(1), voiceServerParts.at(2), voiceServerParts.at(0), -1, CUser());
voiceServers.push_back(voiceServer);
}
break;

View File

@@ -131,9 +131,6 @@ namespace BlackCore
Vat_ConnectProducerConsumerToConsumer(audioMixerVatlib->getVatAudioMixer(), outputPort, nullptr, 0);
}
/*
* Process voice handling
*/
void CVoiceVatlib::timerEvent(QTimerEvent *)
{
Q_ASSERT_X(m_audioService, "CVoiceVatlib", "VatAudioService invalid!");

View File

@@ -40,6 +40,7 @@ namespace BlackCore
class IAudioInputDevice;
class IAudioOutputDevice;
class IVoiceChannel;
namespace Vatsim
{
//! Vatlib implementation of the IVoice interface.
@@ -90,14 +91,12 @@ namespace BlackCore
//! \copydoc IVoice::disconnectVoice()
void disconnectVoice(IAudioMixer *mixer, IAudioMixer::OutputPort outputPort) override;
protected: // QObject overrides
protected:
//! Process voice lib
virtual void timerEvent(QTimerEvent *) override;
private:
// this struct calls "myCustomDeallocator" to delete the pointer
//! this struct calls Vat_DestroyAudioService to delete the pointer
struct VatAudioServiceDeleter
{
static inline void cleanup(VatAudioService_tag *obj)
@@ -106,6 +105,7 @@ namespace BlackCore
}
};
//! this struct calls Vat_DestroyUDPAudioPort to delete the pointer
struct VatUDPAudioPortDeleter
{
static inline void cleanup(VatUDPAudioPort_tag *obj)
@@ -118,7 +118,6 @@ namespace BlackCore
QScopedPointer<VatAudioService_tag, VatAudioServiceDeleter> m_audioService;
QScopedPointer<VatUDPAudioPort_tag, VatUDPAudioPortDeleter> m_udpPort;
};
} // namespace
} // namespace

View File

@@ -157,7 +157,7 @@ namespace BlackMisc
// further reduce
if (patternUsed.hasName())
{
CAirlineIcaoCodeList backup(codesFound);
const CAirlineIcaoCodeList backup(codesFound);
codesFound = this->findByNamesOrTelephonyDesignator(patternUsed.getName());
if (codesFound.isEmpty()) { codesFound = backup; }
}

View File

@@ -22,7 +22,6 @@ namespace BlackMisc
{
namespace Network
{
CVoiceCapabilities::CVoiceCapabilities(const QString &flightPlanRemarks)
{
this->setFromFlightPlanRemarks(flightPlanRemarks);
@@ -66,20 +65,20 @@ namespace BlackMisc
return;
}
const QString r = flightPlanRemarks.toLower();
if (r.contains("/v/") || r.contains("/voice/"))
const QString r = flightPlanRemarks.toUpper(); // normally already upper case
if (r.contains("/V/") || r.contains("/VOICE/"))
{
this->setCapabilities(Voice);
return;
}
if (r.contains("/t/"))
if (r.contains("/T/"))
{
this->setCapabilities(TextOnly);
return;
}
if (r.contains("/r/"))
if (r.contains("/R/"))
{
this->setCapabilities(VoiceReceivingOnly);
return;
@@ -116,15 +115,11 @@ namespace BlackMisc
switch (capabilities)
{
case CVoiceCapabilities::TextOnly:
return to;
case CVoiceCapabilities::Voice:
return v;
case CVoiceCapabilities::VoiceReceivingOnly:
return vro;
case CVoiceCapabilities::TextOnly: return to;
case CVoiceCapabilities::Voice: return v;
case CVoiceCapabilities::VoiceReceivingOnly: return vro;
case CVoiceCapabilities::Unknown:
default:
return u;
default: return u;
}
}
@@ -133,6 +128,5 @@ namespace BlackMisc
static const QList<CVoiceCapabilities> all({fromVoiceCapabilities(Unknown), fromVoiceCapabilities(Voice), fromVoiceCapabilities(VoiceReceivingOnly), fromVoiceCapabilities(TextOnly)});
return all;
}
} // namespace
} // namespace