mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-05 00:44:40 +08:00
Fix clang-tidy and clazy warnings
This commit is contained in:
@@ -798,7 +798,7 @@ namespace BlackSample
|
||||
return set;
|
||||
}
|
||||
|
||||
const QMap<CCallsign, CAircraftSituation> CSamplesPerformance::situationsMap(const CCallsignSet &callsigns)
|
||||
QMap<CCallsign, CAircraftSituation> CSamplesPerformance::situationsMap(const CCallsignSet &callsigns)
|
||||
{
|
||||
QMap<CCallsign, CAircraftSituation> situations;
|
||||
for (const CCallsign &cs : callsigns)
|
||||
@@ -809,7 +809,7 @@ namespace BlackSample
|
||||
return situations;
|
||||
}
|
||||
|
||||
const QHash<CCallsign, CAircraftSituation> CSamplesPerformance::situationsHash(const CCallsignSet &callsigns)
|
||||
QHash<CCallsign, CAircraftSituation> CSamplesPerformance::situationsHash(const CCallsignSet &callsigns)
|
||||
{
|
||||
QHash<CCallsign, CAircraftSituation> situations;
|
||||
for (const CCallsign &cs : callsigns)
|
||||
|
||||
@@ -96,10 +96,10 @@ namespace BlackSample
|
||||
static BlackMisc::Aviation::CCallsignSet callsigns(int number);
|
||||
|
||||
//! Situations map
|
||||
static const QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CAircraftSituation> situationsMap(const BlackMisc::Aviation::CCallsignSet &callsigns);
|
||||
static QMap<BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CAircraftSituation> situationsMap(const BlackMisc::Aviation::CCallsignSet &callsigns);
|
||||
|
||||
//! Situations hash
|
||||
static const QHash<BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CAircraftSituation> situationsHash(const BlackMisc::Aviation::CCallsignSet &callsigns);
|
||||
static QHash<BlackMisc::Aviation::CCallsign, BlackMisc::Aviation::CAircraftSituation> situationsHash(const BlackMisc::Aviation::CCallsignSet &callsigns);
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace BlackConfig
|
||||
return QDateTime::currentDateTime().daysTo(getEol());
|
||||
}
|
||||
|
||||
const QString boolToYesNo(bool v)
|
||||
static QString boolToYesNo(bool v)
|
||||
{
|
||||
return v ? QStringLiteral("yes") : QStringLiteral("no");
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace BlackCore
|
||||
|
||||
void CReceiverSampleProvider::setBypassEffects(bool value)
|
||||
{
|
||||
for (CCallsignSampleProvider *voiceInput : m_voiceInputs)
|
||||
for (CCallsignSampleProvider *voiceInput : std::as_const(m_voiceInputs))
|
||||
{
|
||||
voiceInput->setBypassEffects(value);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace BlackCore
|
||||
{
|
||||
if (frequencyHz != m_frequencyHz)
|
||||
{
|
||||
for (CCallsignSampleProvider *voiceInput : m_voiceInputs)
|
||||
for (CCallsignSampleProvider *voiceInput : std::as_const(m_voiceInputs))
|
||||
{
|
||||
voiceInput->clear();
|
||||
}
|
||||
@@ -88,7 +88,7 @@ namespace BlackCore
|
||||
m_mute = value;
|
||||
if (value)
|
||||
{
|
||||
for (CCallsignSampleProvider *voiceInput : m_voiceInputs)
|
||||
for (CCallsignSampleProvider *voiceInput : std::as_const(m_voiceInputs))
|
||||
{
|
||||
voiceInput->clear();
|
||||
}
|
||||
@@ -120,7 +120,7 @@ namespace BlackCore
|
||||
if (numberOfInUseInputs != m_lastNumberOfInUseInputs)
|
||||
{
|
||||
QStringList receivingCallsigns;
|
||||
for (const CCallsignSampleProvider *voiceInput : m_voiceInputs)
|
||||
for (const CCallsignSampleProvider *voiceInput : std::as_const(m_voiceInputs))
|
||||
{
|
||||
const QString callsign = voiceInput->callsign();
|
||||
if (!callsign.isEmpty())
|
||||
@@ -221,7 +221,7 @@ namespace BlackCore
|
||||
|
||||
QString l;
|
||||
int no = 0;
|
||||
for (const CCallsignSampleProvider *sp : m_voiceInputs)
|
||||
for (const CCallsignSampleProvider *sp : std::as_const(m_voiceInputs))
|
||||
{
|
||||
if (!sp || !sp->inUse()) { continue; } // only log the ones in use
|
||||
l += (l.isEmpty() ? QStringLiteral("") : QStringLiteral("\n")) %
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace BlackCore
|
||||
|
||||
void CSoundcardSampleProvider::setBypassEffects(bool value)
|
||||
{
|
||||
for (CReceiverSampleProvider *receiverInput : m_receiverInputs)
|
||||
for (CReceiverSampleProvider *receiverInput : std::as_const(m_receiverInputs))
|
||||
{
|
||||
receiverInput->setBypassEffects(value);
|
||||
}
|
||||
@@ -60,7 +60,7 @@ namespace BlackCore
|
||||
{
|
||||
if (active)
|
||||
{
|
||||
if (txTransceivers.size() > 0)
|
||||
if (!txTransceivers.isEmpty())
|
||||
{
|
||||
QVector<TxTransceiverDto> txTransceiversFiltered = txTransceivers;
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace BlackCore
|
||||
}
|
||||
else
|
||||
{
|
||||
for (CReceiverSampleProvider *receiverInput : m_receiverInputs)
|
||||
for (CReceiverSampleProvider *receiverInput : std::as_const(m_receiverInputs))
|
||||
{
|
||||
receiverInput->setMute(false);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ namespace BlackCore
|
||||
return a.distanceRatio > b.distanceRatio;
|
||||
});
|
||||
|
||||
if (rxTransceiversFilteredAndSorted.size() > 0)
|
||||
if (!rxTransceiversFilteredAndSorted.isEmpty())
|
||||
{
|
||||
bool audioPlayed = false;
|
||||
QVector<quint16> handledTransceiverIDs;
|
||||
@@ -171,7 +171,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
for (CReceiverSampleProvider *receiverInput : m_receiverInputs)
|
||||
for (CReceiverSampleProvider *receiverInput : std::as_const(m_receiverInputs))
|
||||
{
|
||||
const quint16 transceiverID = receiverInput->getId();
|
||||
const bool contains = std::any_of(radioTransceivers.cbegin(), radioTransceivers.cend(), [ transceiverID ](const auto &tx) { return transceiverID == tx.id; });
|
||||
|
||||
@@ -876,7 +876,7 @@ namespace BlackCore
|
||||
|
||||
const QString callsign = this->getCallsign(); // threadsafe
|
||||
const auto transmittingTransceivers = this->getTransmittingTransceivers(); // threadsafe
|
||||
if (transmittingTransceivers.size() > 0)
|
||||
if (!transmittingTransceivers.isEmpty())
|
||||
{
|
||||
if (transmit)
|
||||
{
|
||||
|
||||
@@ -158,7 +158,7 @@ namespace BlackCore
|
||||
break;
|
||||
}
|
||||
|
||||
if (modelsWithAirline.size() > 0)
|
||||
if (!modelsWithAirline.isEmpty())
|
||||
{
|
||||
if (modelsWithAirline.size() > 1)
|
||||
{
|
||||
@@ -181,7 +181,7 @@ namespace BlackCore
|
||||
break;
|
||||
}
|
||||
|
||||
if (modelsWithAirline.size() > 0)
|
||||
if (!modelsWithAirline.isEmpty())
|
||||
{
|
||||
if (modelsWithAirline.size() > 1)
|
||||
{
|
||||
@@ -211,7 +211,7 @@ namespace BlackCore
|
||||
CCallsign::addLogDetailsToList(log, callsign, QStringLiteral("Found only 1 airline ICAO '%1' in %2 models").arg(countPerAirline.firstKey().getDesignatorDbKey()).arg(models.size()), getLogCategories());
|
||||
break;
|
||||
}
|
||||
if (modelsWithAirline.size() > 0)
|
||||
if (!modelsWithAirline.isEmpty())
|
||||
{
|
||||
if (modelsWithAirline.size() > 1)
|
||||
{
|
||||
@@ -1033,7 +1033,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
if (foundIcaos.size() < 1)
|
||||
if (foundIcaos.isEmpty())
|
||||
{
|
||||
CCallsign::addLogDetailsToList(log, logCallsign, QStringLiteral("Reverse lookup of aircraft ICAO '%1', nothing found").arg(designator), CAircraftMatcher::getLogCategories());
|
||||
return CAircraftIcaoCode(icaoCandidate);
|
||||
@@ -1882,7 +1882,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
CAircraftModelList step1Data = inList.findByAirlineNamesOrTelephonyDesignator(airlineName);
|
||||
if (step1Data.size() < 1 || step1Data.size() == inList.size())
|
||||
if (step1Data.isEmpty() || step1Data.size() == inList.size())
|
||||
{
|
||||
if (log) { CCallsign::addLogDetailsToList(log, cs, info % QStringLiteral(" cannot reduce by '%1'").arg(airlineName), getLogCategories()); }
|
||||
step1Data = inList;
|
||||
@@ -1895,7 +1895,7 @@ namespace BlackCore
|
||||
if (step1Data.size() == 1) { return step1Data; }
|
||||
|
||||
CAircraftModelList step2Data = inList.findByAirlineNamesOrTelephonyDesignator(telephony);
|
||||
if (step2Data.size() < 1 || step2Data.size() == inList.size())
|
||||
if (step2Data.isEmpty() || step2Data.size() == inList.size())
|
||||
{
|
||||
if (log) { CCallsign::addLogDetailsToList(log, cs, info % QStringLiteral(" cannot reduce by '%1'").arg(telephony), getLogCategories()); }
|
||||
step2Data = step1Data;
|
||||
|
||||
@@ -1327,7 +1327,7 @@ namespace BlackCore
|
||||
// If there is no full position available yet, throw this interim position away.
|
||||
CAircraftSituation interimSituation(situation);
|
||||
CAircraftSituationList history = this->remoteAircraftSituations(callsign);
|
||||
if (history.empty()) { return; } // we need one full situation at least
|
||||
if (history.isEmpty()) { return; } // we need one full situation at least
|
||||
const CAircraftSituation lastSituation = history.latestObject();
|
||||
|
||||
// changed position, continue and copy values
|
||||
|
||||
@@ -1709,7 +1709,7 @@ namespace BlackCore
|
||||
if (m_webDataServices)
|
||||
{
|
||||
const CUrlList urls(m_webDataServices->getVatsimMetarUrls());
|
||||
if (!urls.empty()) { return urls; }
|
||||
if (!urls.isEmpty()) { return urls; }
|
||||
}
|
||||
if (m_setupReader)
|
||||
{
|
||||
@@ -1724,7 +1724,7 @@ namespace BlackCore
|
||||
if (m_webDataServices)
|
||||
{
|
||||
const CUrlList urls(m_webDataServices->getVatsimDataFileUrls());
|
||||
if (!urls.empty()) { return urls; }
|
||||
if (!urls.isEmpty()) { return urls; }
|
||||
}
|
||||
if (m_setupReader)
|
||||
{
|
||||
|
||||
@@ -596,7 +596,7 @@ namespace BlackCore
|
||||
CCallsignSet callsigns;
|
||||
callsigns.push_back(callsign);
|
||||
const CUserList users = this->getUsersForCallsigns(callsigns);
|
||||
if (users.size() < 1) { return CUser(); }
|
||||
if (users.isEmpty()) { return CUser(); }
|
||||
return users[0];
|
||||
}
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ namespace BlackCore
|
||||
virtual bool testRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool add) = 0;
|
||||
|
||||
//! Test update remote aircraft
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) = 0;
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign &cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) = 0;
|
||||
|
||||
//! Get matching setup
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const = 0;
|
||||
|
||||
@@ -437,7 +437,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::testUpdateRemoteAircraft
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign &cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override
|
||||
{
|
||||
Q_UNUSED(cs)
|
||||
Q_UNUSED(situation)
|
||||
|
||||
@@ -1066,7 +1066,7 @@ namespace BlackCore
|
||||
return added;
|
||||
}
|
||||
|
||||
bool CContextSimulator::testUpdateRemoteAircraft(const CCallsign cs, const CAircraftSituation &situation, const CAircraftParts &parts)
|
||||
bool CContextSimulator::testUpdateRemoteAircraft(const CCallsign &cs, const CAircraftSituation &situation, const CAircraftParts &parts)
|
||||
{
|
||||
if (!m_simulatorPlugin.second || !m_simulatorPlugin.second->isConnected()) { return false; }
|
||||
CAircraftSituation s = situation; // make sure to have correct callsign
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const override;
|
||||
virtual BlackMisc::CStatusMessageList copyFsxTerrainProbe(const BlackMisc::Simulation::CSimulatorInfo &simulator) override;
|
||||
virtual bool testRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool add) override;
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override;
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign &cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override;
|
||||
|
||||
// also in IAircraftModelSetProvider
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSet() const override;
|
||||
|
||||
@@ -391,7 +391,7 @@ namespace BlackCore
|
||||
return m_dBusInterface->callDBusRet<bool>(QLatin1String("testRemoteAircraft"), aircraft, add);
|
||||
}
|
||||
|
||||
bool CContextSimulatorProxy::testUpdateRemoteAircraft(const CCallsign cs, const CAircraftSituation &situation, const CAircraftParts &parts)
|
||||
bool CContextSimulatorProxy::testUpdateRemoteAircraft(const CCallsign &cs, const CAircraftSituation &situation, const CAircraftParts &parts)
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<bool>(QLatin1String("testUpdateRemoteAircraft"), cs, situation, parts);
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const override;
|
||||
virtual BlackMisc::CStatusMessageList copyFsxTerrainProbe(const BlackMisc::Simulation::CSimulatorInfo &simulator) override;
|
||||
virtual bool testRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, bool add) override;
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override;
|
||||
virtual bool testUpdateRemoteAircraft(const BlackMisc::Aviation::CCallsign &cs, const BlackMisc::Aviation::CAircraftSituation &situation, const BlackMisc::Aviation::CAircraftParts &parts) override;
|
||||
//! @}
|
||||
|
||||
private:
|
||||
|
||||
@@ -330,12 +330,12 @@ namespace BlackCore
|
||||
|
||||
bool CDatabaseReader::hasDbInfoObjects() const
|
||||
{
|
||||
return getDbInfoObjects().size() > 0;
|
||||
return !getDbInfoObjects().isEmpty();
|
||||
}
|
||||
|
||||
bool CDatabaseReader::hasSharedInfoObjects() const
|
||||
{
|
||||
return getSharedInfoObjects().size() > 0;
|
||||
return !getSharedInfoObjects().isEmpty();
|
||||
}
|
||||
|
||||
bool CDatabaseReader::hasSharedFileHeader(const CEntityFlags::Entity entity) const
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace BlackCore
|
||||
|
||||
DeleteAtc DeleteAtc::fromTokens(const QStringList &tokens)
|
||||
{
|
||||
if (tokens.size() < 1)
|
||||
if (tokens.isEmpty())
|
||||
{
|
||||
BlackMisc::CLogMessage(static_cast<DeleteAtc *>(nullptr)).debug(u"Wrong number of arguments.");
|
||||
return {};
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackCore
|
||||
|
||||
DeletePilot DeletePilot::fromTokens(const QStringList &tokens)
|
||||
{
|
||||
if (tokens.size() < 1)
|
||||
if (tokens.isEmpty())
|
||||
{
|
||||
CLogMessage(static_cast<DeletePilot *>(nullptr)).debug(u"Wrong number of arguments.");
|
||||
return {};
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2019
|
||||
/* Copyright (C) 2019
|
||||
* swift project community / contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
@@ -433,12 +433,12 @@ namespace BlackCore
|
||||
sendClientQuery(ClientQueryType::ATIS, callsign);
|
||||
}
|
||||
|
||||
void CFSDClient::sendClientQueryFlightPlan(const CCallsign callsign)
|
||||
void CFSDClient::sendClientQueryFlightPlan(const CCallsign &callsign)
|
||||
{
|
||||
sendClientQuery(ClientQueryType::FP, {}, { callsign.toQString() });
|
||||
}
|
||||
|
||||
void CFSDClient::sendClientQueryAircraftConfig(const CCallsign callsign)
|
||||
void CFSDClient::sendClientQueryAircraftConfig(const CCallsign &callsign)
|
||||
{
|
||||
QString data = QJsonDocument(JsonPackets::aircraftConfigRequest()).toJson(QJsonDocument::Compact);
|
||||
data = convertToUnicodeEscaped(data);
|
||||
@@ -504,13 +504,13 @@ namespace BlackCore
|
||||
}
|
||||
else if (queryType == ClientQueryType::FP)
|
||||
{
|
||||
if (queryData.size() == 0) { return; }
|
||||
if (queryData.isEmpty()) { return; }
|
||||
const ClientQuery clientQuery(getOwnCallsignAsString(), "SERVER", ClientQueryType::FP, queryData);
|
||||
sendQueudedMessage(clientQuery);
|
||||
}
|
||||
else if (queryType == ClientQueryType::AircraftConfig)
|
||||
{
|
||||
if (queryData.size() == 0) { return; }
|
||||
if (queryData.isEmpty()) { return; }
|
||||
const ClientQuery clientQuery(getOwnCallsignAsString(), reveiverCallsign, ClientQueryType::AircraftConfig, queryData);
|
||||
sendQueudedMessage(clientQuery);
|
||||
}
|
||||
@@ -1342,7 +1342,7 @@ namespace BlackCore
|
||||
if (!inRange) { return; } // sort out all broadcasted we DO NOT NEED
|
||||
if (!getSetupForServer().receiveAircraftParts()) { return; }
|
||||
const QJsonObject config = doc.object().value("config").toObject();
|
||||
if (config.empty()) { return; }
|
||||
if (config.isEmpty()) { return; }
|
||||
|
||||
const qint64 offsetTimeMs = currentOffsetTime(callsign);
|
||||
emit aircraftConfigReceived(clientQuery.sender(), config, offsetTimeMs);
|
||||
@@ -1938,7 +1938,7 @@ namespace BlackCore
|
||||
if (!callByTime.isEmpty())
|
||||
{
|
||||
const qint64 lastTs = callByTime.front().first;
|
||||
for (const auto &pair : callByTime)
|
||||
for (const auto &pair : std::as_const(callByTime))
|
||||
{
|
||||
const qint64 deltaTs = lastTs - pair.first;
|
||||
stats += separator % QStringLiteral("%1").arg(deltaTs, 5, 10, QChar('0')) % u": " % pair.second;
|
||||
@@ -2175,7 +2175,7 @@ namespace BlackCore
|
||||
emit atisLogoffTimeReplyReceived(cs, m_mapAtisMessages[callsign].zuluLogoff);
|
||||
|
||||
CInformationMessage atisMessage(CInformationMessage::ATIS);
|
||||
for (const QString &tm : m_mapAtisMessages[callsign].textLines)
|
||||
for (const QString &tm : std::as_const(m_mapAtisMessages[callsign].textLines))
|
||||
{
|
||||
const QString fixed = tm.trimmed();
|
||||
if (!fixed.isEmpty())
|
||||
|
||||
@@ -162,8 +162,8 @@ namespace BlackCore
|
||||
void sendClientQueryRealName(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendClientQueryServer(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendClientQueryAtis(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendClientQueryFlightPlan(const BlackMisc::Aviation::CCallsign callsign);
|
||||
void sendClientQueryAircraftConfig(const BlackMisc::Aviation::CCallsign callsign);
|
||||
void sendClientQueryFlightPlan(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendClientQueryAircraftConfig(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
void sendTextMessages(const BlackMisc::Network::CTextMessageList &messages);
|
||||
void sendTextMessage(const BlackMisc::Network::CTextMessage &message);
|
||||
void sendTextMessage(TextMessageGroups receiverGroup, const QString &message);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackCore
|
||||
void CWeatherManager::appendRequest(const WeatherRequest &request)
|
||||
{
|
||||
const qint64 now = QDateTime::currentMSecsSinceEpoch();
|
||||
if (m_pendingRequests.size() > 0 && m_lastPendingRequestTs > 0)
|
||||
if (!m_pendingRequests.isEmpty() && m_lastPendingRequestTs > 0)
|
||||
{
|
||||
const qint64 pendingMs = now - m_lastPendingRequestTs;
|
||||
if (pendingMs > 30 * 1000)
|
||||
@@ -227,7 +227,7 @@ namespace BlackCore
|
||||
m_pendingRequests.pop_front();
|
||||
|
||||
// In case there are pending requests, start over again
|
||||
if (m_pendingRequests.size() > 0)
|
||||
if (!m_pendingRequests.isEmpty())
|
||||
{
|
||||
fetchNextWeatherData();
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace BlackGui
|
||||
if (m_cc == cc) { return; }
|
||||
m_cc = cc;
|
||||
|
||||
if (cc.length() > 0) { aircraftType = cc.left(1); }
|
||||
if (cc.length() > 0) { aircraftType = cc.at(0); }
|
||||
if (cc.length() > 1) { engineCount = cc.mid(1, 1); }
|
||||
if (cc.length() > 2) { engineType = cc.mid(2, 1); }
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace BlackGui
|
||||
|
||||
void CAirportCompleter::onAirportsChanged()
|
||||
{
|
||||
if (!sGui && !sGui->hasWebDataServices()) { return; }
|
||||
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
||||
const CAirportList airports = sGui->getWebDataServices()->getAirports();
|
||||
ui->le_Icao->setCompleter(new QCompleter(airports.allIcaoCodes(true), ui->le_Icao));
|
||||
ui->le_Name->setCompleter(new QCompleter(airports.allDescriptivesNames(true), ui->le_Name));
|
||||
|
||||
@@ -104,7 +104,7 @@ namespace BlackGui
|
||||
|
||||
void CAirportSmallCompleter::onIcaoChanged()
|
||||
{
|
||||
if (!sGui && !sGui->hasWebDataServices()) { return; }
|
||||
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
||||
const CAirport airport = sGui->getWebDataServices()->getAirportForIcaoDesignator(this->getIcaoText());
|
||||
if (!airport.isNull())
|
||||
{
|
||||
@@ -114,7 +114,7 @@ namespace BlackGui
|
||||
|
||||
void CAirportSmallCompleter::onAirportsChanged()
|
||||
{
|
||||
if (!sGui && !sGui->hasWebDataServices()) { return; }
|
||||
if (!sGui || !sGui->hasWebDataServices()) { return; }
|
||||
const CAirportList airports = sGui->getWebDataServices()->getAirports();
|
||||
ui->le_Icao->setCompleter(new QCompleter(airports.allIcaoCodes(true), ui->le_Icao));
|
||||
|
||||
|
||||
@@ -536,7 +536,7 @@ namespace BlackGui
|
||||
void CAtcStationComponent::showOverlayInlineTextMessage()
|
||||
{
|
||||
// COverlayMessagesFrame::showOverlayInlineTextMessage(TextMessagesCom1);
|
||||
this->requestTextMessageEntryTab(TextMessagesCom1);
|
||||
emit requestTextMessageEntryTab(TextMessagesCom1);
|
||||
}
|
||||
|
||||
void CAtcStationComponent::onDetailsToggled(bool checked)
|
||||
|
||||
@@ -120,18 +120,18 @@ namespace BlackGui
|
||||
|
||||
void CCockpitComponent::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
{
|
||||
if (event) { this->requestTextMessageEntryTab(TextMessagesAll); }
|
||||
if (event) { emit requestTextMessageEntryTab(TextMessagesAll); }
|
||||
COverlayMessagesFrame::mouseDoubleClickEvent(event);
|
||||
}
|
||||
|
||||
void CCockpitComponent::onRequestTextMessageCom1()
|
||||
{
|
||||
this->requestTextMessageEntryTab(TextMessagesCom1);
|
||||
emit requestTextMessageEntryTab(TextMessagesCom1);
|
||||
}
|
||||
|
||||
void CCockpitComponent::onRequestTextMessageCom2()
|
||||
{
|
||||
this->requestTextMessageEntryTab(TextMessagesCom2);
|
||||
emit requestTextMessageEntryTab(TextMessagesCom2);
|
||||
}
|
||||
|
||||
void CCockpitComponent::onATCStationsChanged()
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace BlackGui
|
||||
this->setColor(CRgbColor(color));
|
||||
}
|
||||
|
||||
const BlackMisc::CRgbColor CColorSelector::getColor() const
|
||||
BlackMisc::CRgbColor CColorSelector::getColor() const
|
||||
{
|
||||
CRgbColor q(ui->le_Color->text());
|
||||
return q;
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace BlackGui
|
||||
void setColor(const QColor &color);
|
||||
|
||||
//! Selected color
|
||||
const BlackMisc::CRgbColor getColor() const;
|
||||
BlackMisc::CRgbColor getColor() const;
|
||||
|
||||
//! Read only
|
||||
void setReadOnly(bool readOnly);
|
||||
|
||||
@@ -54,9 +54,8 @@ namespace BlackGui
|
||||
if (sApp && sApp->hasWebDataServices())
|
||||
{
|
||||
connect(sApp->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbAircraftIcaoSelectorComponent::onCodesRead, Qt::QueuedConnection);
|
||||
this->onCodesRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFinished, sApp->getWebDataServices()->getAircraftIcaoCodesCount());
|
||||
}
|
||||
|
||||
this->onCodesRead(CEntityFlags::AircraftIcaoEntity, CEntityFlags::ReadFinished, sApp->getWebDataServices()->getAircraftIcaoCodesCount());
|
||||
}
|
||||
|
||||
CDbAircraftIcaoSelectorComponent::~CDbAircraftIcaoSelectorComponent()
|
||||
|
||||
@@ -46,9 +46,8 @@ namespace BlackGui
|
||||
if (sGui && sGui->getWebDataServices())
|
||||
{
|
||||
connect(sGui->getWebDataServices(), &CWebDataServices::dataRead, this, &CDbDistributorComponent::onDistributorsRead, Qt::QueuedConnection);
|
||||
this->onDistributorsRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getDistributorsCount());
|
||||
}
|
||||
|
||||
this->onDistributorsRead(CEntityFlags::DistributorEntity, CEntityFlags::ReadFinished, sGui->getWebDataServices()->getDistributorsCount());
|
||||
}
|
||||
|
||||
CDbDistributorComponent::~CDbDistributorComponent()
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace BlackGui
|
||||
displayOverlayMessages(msgs);
|
||||
return;
|
||||
}
|
||||
else if (!msgs.empty())
|
||||
else if (!msgs.isEmpty())
|
||||
{
|
||||
CLogMessage::preformatted(msgs);
|
||||
}
|
||||
|
||||
@@ -844,7 +844,7 @@ namespace BlackGui
|
||||
return ui->comp_OwnAircraftModels->getOwnModelForModelString(modelString);
|
||||
}
|
||||
|
||||
const CSimulatorInfo CDbMappingComponent::getOwnModelsSimulator() const
|
||||
CSimulatorInfo CDbMappingComponent::getOwnModelsSimulator() const
|
||||
{
|
||||
return ui->comp_OwnAircraftModels->getOwnModelsSimulator();
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace BlackGui
|
||||
BlackMisc::Simulation::CAircraftModel getOwnModelForModelString(const QString &modelString) const;
|
||||
|
||||
//! Own models for simulator
|
||||
const BlackMisc::Simulation::CSimulatorInfo getOwnModelsSimulator() const;
|
||||
BlackMisc::Simulation::CSimulatorInfo getOwnModelsSimulator() const;
|
||||
|
||||
//! Set simulator for own models
|
||||
void setOwnModelsSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator);
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace BlackGui
|
||||
return ui->tvp_OwnAircraftModels->selectedObjects();
|
||||
}
|
||||
|
||||
const CSimulatorInfo CDbOwnModelsComponent::getOwnModelsSimulator() const
|
||||
CSimulatorInfo CDbOwnModelsComponent::getOwnModelsSimulator() const
|
||||
{
|
||||
return ui->comp_SimulatorSelector->getValue();
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace BlackGui
|
||||
BlackMisc::Simulation::CAircraftModelList getOwnSelectedModels() const;
|
||||
|
||||
//! Own models for simulator
|
||||
const BlackMisc::Simulation::CSimulatorInfo getOwnModelsSimulator() const;
|
||||
BlackMisc::Simulation::CSimulatorInfo getOwnModelsSimulator() const;
|
||||
|
||||
//! Change current simulator for own models
|
||||
bool setSimulator(const BlackMisc::Simulation::CSimulatorInfo &simulator, bool forced = false);
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace BlackGui
|
||||
if (!myself || !sGui || sGui->isShuttingDown()) { return; }
|
||||
myself->ui->pb_Download->setEnabled(true);
|
||||
myself->ui->pb_Launch->setEnabled(true);
|
||||
this->allDownloadsCompleted();
|
||||
emit allDownloadsCompleted();
|
||||
});
|
||||
this->startDownloadedExecutable();
|
||||
}
|
||||
|
||||
@@ -143,11 +143,11 @@ namespace BlackGui
|
||||
CLogMessage::preformatted(msg);
|
||||
if (msg.isSuccess())
|
||||
{
|
||||
emit this->loginOrLogoffSuccessful();
|
||||
emit loginOrLogoffSuccessful();
|
||||
}
|
||||
else
|
||||
{
|
||||
emit this->cancel();
|
||||
this->cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace BlackGui
|
||||
CMainKeypadAreaComponent::~CMainKeypadAreaComponent()
|
||||
{ }
|
||||
|
||||
void CMainKeypadAreaComponent::onMainInfoAreaChanged(int currentTabIndex, QList<int> dockedIndexes, QList<int> floatingIndexes)
|
||||
void CMainKeypadAreaComponent::onMainInfoAreaChanged(int currentTabIndex, const QList<int> &dockedIndexes, const QList<int> &floatingIndexes)
|
||||
{
|
||||
this->unsetInfoAreaButtons();
|
||||
if (currentTabIndex >= 0)
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace BlackGui
|
||||
virtual ~CMainKeypadAreaComponent() override;
|
||||
|
||||
//! Main info area changed
|
||||
void onMainInfoAreaChanged(int currentTabIndex, QList<int> dockedIndexes, QList<int> floatingIndexes);
|
||||
void onMainInfoAreaChanged(int currentTabIndex, const QList<int> &dockedIndexes, const QList<int> &floatingIndexes);
|
||||
|
||||
//! Focus in entry fields
|
||||
void focusInEntryField();
|
||||
|
||||
@@ -37,11 +37,11 @@ namespace BlackGui
|
||||
ui->gv_RadarView->setScene(&m_scene);
|
||||
|
||||
ui->cb_RadarRange->addItem(QString::number(0.5) % u" nm", 0.5);
|
||||
for (qreal r = 1.0; r < 10; r += 1)
|
||||
for (int r = 1; r <= 9; ++r)
|
||||
{
|
||||
ui->cb_RadarRange->addItem(QString::number(r) % u" nm", r);
|
||||
}
|
||||
for (qreal r = 10; r < 91; r += 10)
|
||||
for (int r = 10; r <= 90; r += 10)
|
||||
{
|
||||
ui->cb_RadarRange->addItem(QString::number(r) % u" nm", r);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace BlackGui
|
||||
pen.setCosmetic(true);
|
||||
|
||||
// Macro graticule, drawn as full line at every 10 nm
|
||||
for (qreal range = 10.0; range < 101.0; range += 10.0)
|
||||
for (int range = 10; range <= 100; range += 10)
|
||||
{
|
||||
QGraphicsEllipseItem *circle = new QGraphicsEllipseItem(-range, -range, 2.0 * range, 2.0 * range, &m_macroGraticule);
|
||||
circle->setPen(pen);
|
||||
@@ -119,9 +119,9 @@ namespace BlackGui
|
||||
pen.setCosmetic(true);
|
||||
|
||||
// Micro graticule, drawn as dash line at every 2.5 nm
|
||||
for (qreal range = 2.5; range < 9.9; range += 2.5)
|
||||
for (qreal range = 1; range <= 3; ++range)
|
||||
{
|
||||
QGraphicsEllipseItem *circle = new QGraphicsEllipseItem(-range, -range, 2.0 * range, 2.0 * range, &m_microGraticule);
|
||||
QGraphicsEllipseItem *circle = new QGraphicsEllipseItem(-range * 2.5, -range * 2.5, 5.0 * range, 5.0 * range, &m_microGraticule);
|
||||
circle->setPen(pen);
|
||||
}
|
||||
}
|
||||
@@ -131,9 +131,9 @@ namespace BlackGui
|
||||
QPen pen(Qt::gray, 1, Qt::DashDotDotLine);
|
||||
pen.setCosmetic(true);
|
||||
|
||||
for (qreal angle = 0.0; angle < 359.0; angle += 30.0)
|
||||
for (int angle = 0; angle < 360; angle += 30)
|
||||
{
|
||||
const QLineF line({ 0.0, 0.0 }, polarPoint(1000.0, qDegreesToRadians(angle)));
|
||||
const QLineF line({ 0.0, 0.0 }, polarPoint(1000.0, qDegreesToRadians(static_cast<qreal>(angle))));
|
||||
QGraphicsLineItem *li = new QGraphicsLineItem(line, &m_radials);
|
||||
li->setFlags(QGraphicsItem::ItemIgnoresTransformations);
|
||||
li->setPen(pen);
|
||||
|
||||
@@ -629,7 +629,6 @@ namespace BlackGui
|
||||
QWidget *CTextMessageComponent::findTextMessageTabByName(const QString &name) const
|
||||
{
|
||||
if (name.isEmpty()) { return nullptr; }
|
||||
const QString n = name.trimmed();
|
||||
|
||||
// search the private message tabs first
|
||||
for (int index = ui->tw_TextMessages->count() - 1; index >= 0; index--)
|
||||
@@ -685,7 +684,7 @@ namespace BlackGui
|
||||
{
|
||||
const CCallsign cs(tab->property("callsign").toString());
|
||||
if (!validated) { return cs; }
|
||||
if (!sGui && sGui->getIContextNetwork())
|
||||
if (sGui && sGui->getIContextNetwork())
|
||||
{
|
||||
const CAtcStation atc = sGui->getIContextNetwork()->getOnlineStationForCallsign(cs);
|
||||
if (atc.hasCallsign()) { return atc.getCallsign(); } // first hand callsign diretcly from network context
|
||||
|
||||
@@ -257,7 +257,7 @@ namespace BlackGui
|
||||
return CPlatform::stringToPlatformObject(p);
|
||||
}
|
||||
|
||||
const CDistribution CUpdateInfoComponent::getSelectedOrDefaultDistribution() const
|
||||
CDistribution CUpdateInfoComponent::getSelectedOrDefaultDistribution() const
|
||||
{
|
||||
const QStringList settings = m_updateSettings.get(); // channel / platform
|
||||
QString c = ui->cb_Channels->currentText();
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace BlackGui
|
||||
const BlackMisc::CPlatform &getSelectedOrDefaultPlatform() const;
|
||||
|
||||
//! Selected or default distribution
|
||||
const BlackMisc::Db::CDistribution getSelectedOrDefaultDistribution() const;
|
||||
BlackMisc::Db::CDistribution getSelectedOrDefaultDistribution() const;
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace BlackGui
|
||||
return nestedInfoAreas;
|
||||
}
|
||||
|
||||
const QList<const CInfoArea *> CDockWidgetInfoArea::findParentInfoAreas() const
|
||||
QList<const CInfoArea *> CDockWidgetInfoArea::findParentInfoAreas() const
|
||||
{
|
||||
QList<const CInfoArea *> parents;
|
||||
QWidget *currentWidget = this->parentWidget();
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace BlackGui
|
||||
QList<CDockWidgetInfoArea *> findNestedInfoAreas();
|
||||
|
||||
//! The parent info areas
|
||||
const QList<const CInfoArea *> findParentInfoAreas() const;
|
||||
QList<const CInfoArea *> findParentInfoAreas() const;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace BlackGui
|
||||
|
||||
void CBarChart::setSymbols(const QStringList &titles, const QStringList &colors)
|
||||
{
|
||||
Q_ASSERT_X(titles.size() > 0, Q_FUNC_INFO, "Need titles");
|
||||
Q_ASSERT_X(!titles.isEmpty(), Q_FUNC_INFO, "Need titles");
|
||||
Q_ASSERT_X(titles.size() == colors.size(), Q_FUNC_INFO, "Need same size");
|
||||
|
||||
int i = 0;
|
||||
@@ -135,9 +135,7 @@ namespace BlackGui
|
||||
QVector< QVector<double> > series;
|
||||
for (double d : samples)
|
||||
{
|
||||
QVector<double> values;
|
||||
values << d;
|
||||
series << values;
|
||||
series << QVector<double> { d };
|
||||
}
|
||||
|
||||
if (orientation == Qt::Vertical)
|
||||
|
||||
@@ -385,7 +385,7 @@ namespace BlackGui
|
||||
{
|
||||
const QWidget *w = CGuiApplication::mainApplicationWidget();
|
||||
const int s = QApplication::desktop()->screenNumber(w);
|
||||
if (s < QGuiApplication::screens().size()) { return QGuiApplication::screens()[s]; }
|
||||
if (s < QGuiApplication::screens().size()) { return QGuiApplication::screens().at(s); }
|
||||
return QGuiApplication::primaryScreen();
|
||||
}
|
||||
|
||||
@@ -1039,7 +1039,7 @@ namespace BlackGui
|
||||
{
|
||||
if (this->isShuttingDown()) { return; }
|
||||
if (!qObject || qObject->objectName().isEmpty()) { this->showHelp(); }
|
||||
this->showHelp(qObject->objectName());
|
||||
else { this->showHelp(qObject->objectName()); }
|
||||
}
|
||||
|
||||
bool CGuiApplication::triggerShowHelp(const QWidget *widget, QEvent *event)
|
||||
|
||||
@@ -263,22 +263,22 @@ namespace BlackGui
|
||||
return unknown;
|
||||
}
|
||||
|
||||
const QString CGuiUtility::rectAsString(const QRect &rect)
|
||||
QString CGuiUtility::rectAsString(const QRect &rect)
|
||||
{
|
||||
return QStringLiteral("x: %1 y: %2 w: %3 h: %4").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height());
|
||||
}
|
||||
|
||||
const QString CGuiUtility::rectAsString(const QRectF &rect)
|
||||
QString CGuiUtility::rectAsString(const QRectF &rect)
|
||||
{
|
||||
return QStringLiteral("x: %1 y: %2 w: %3 h: %4").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height());
|
||||
}
|
||||
|
||||
const QString CGuiUtility::sizeAsString(const QSize &size)
|
||||
QString CGuiUtility::sizeAsString(const QSize &size)
|
||||
{
|
||||
return QStringLiteral("w: %1 h: %2").arg(size.width()).arg(size.height());
|
||||
}
|
||||
|
||||
const QString CGuiUtility::sizeAsString(const QSizeF &size)
|
||||
QString CGuiUtility::sizeAsString(const QSizeF &size)
|
||||
{
|
||||
return QStringLiteral("w: %1 h: %2").arg(size.width()).arg(size.height());
|
||||
}
|
||||
@@ -972,7 +972,7 @@ namespace BlackGui
|
||||
return openWidgets;
|
||||
}
|
||||
|
||||
QStringList CGuiUtility::getAllWidgetTitles(const QWidgetList widgets)
|
||||
QStringList CGuiUtility::getAllWidgetTitles(const QWidgetList &widgets)
|
||||
{
|
||||
QStringList titles;
|
||||
for (const QWidget *w : widgets)
|
||||
@@ -990,7 +990,7 @@ namespace BlackGui
|
||||
return titles;
|
||||
}
|
||||
|
||||
QStringList CGuiUtility::getAllWidgetNames(const QWidgetList widgets)
|
||||
QStringList CGuiUtility::getAllWidgetNames(const QWidgetList &widgets)
|
||||
{
|
||||
QStringList titles;
|
||||
for (const QWidget *w : widgets)
|
||||
|
||||
@@ -87,10 +87,10 @@ namespace BlackGui
|
||||
|
||||
//! QRect, QSize as string
|
||||
//! @{
|
||||
static const QString rectAsString(const QRect &rect);
|
||||
static const QString rectAsString(const QRectF &rect);
|
||||
static const QString sizeAsString(const QSize &size);
|
||||
static const QString sizeAsString(const QSizeF &size);
|
||||
static QString rectAsString(const QRect &rect);
|
||||
static QString rectAsString(const QRectF &rect);
|
||||
static QString sizeAsString(const QSize &size);
|
||||
static QString sizeAsString(const QSizeF &size);
|
||||
//! @}
|
||||
|
||||
//! Top level widgets with names
|
||||
@@ -292,10 +292,10 @@ namespace BlackGui
|
||||
static QWidgetList getAllModallWidgets();
|
||||
|
||||
//! All titles
|
||||
static QStringList getAllWidgetTitles(const QWidgetList widgets);
|
||||
static QStringList getAllWidgetTitles(const QWidgetList &widgets);
|
||||
|
||||
//! All names
|
||||
static QStringList getAllWidgetNames(const QWidgetList widgets);
|
||||
static QStringList getAllWidgetNames(const QWidgetList &widgets);
|
||||
|
||||
//! Get all dock widgets
|
||||
static QList<QDockWidget *> getAllDockWidgets(QWidget *parent, bool floatingOnly);
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace BlackGui
|
||||
QMenu *currentMenu = nullptr;
|
||||
|
||||
// reverse iteration because same key values are inserted and have reverse order
|
||||
for (const CMenuAction &menuAction : actions)
|
||||
for (const CMenuAction &menuAction : std::as_const(actions))
|
||||
{
|
||||
// create submenu if required
|
||||
if (!currentMenu)
|
||||
|
||||
@@ -220,7 +220,7 @@ namespace BlackGui
|
||||
return false;
|
||||
}
|
||||
|
||||
void CColumns::setWidthPercentages(const QList<int> percentages)
|
||||
void CColumns::setWidthPercentages(const QList<int> &percentages)
|
||||
{
|
||||
if (percentages.isEmpty())
|
||||
{
|
||||
|
||||
@@ -232,7 +232,7 @@ namespace BlackGui
|
||||
bool hasAnyWidthPercentage() const;
|
||||
|
||||
//! Set the width percentages
|
||||
void setWidthPercentages(const QList<int> percentages);
|
||||
void setWidthPercentages(const QList<int> &percentages);
|
||||
|
||||
//! Calculate the absolute width
|
||||
QList<int> calculateWidths(int totalWidth) const;
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace BlackGui
|
||||
return k;
|
||||
}
|
||||
|
||||
const QString CShortcut::toParenthesisString(const QKeySequence &sequence)
|
||||
QString CShortcut::toParenthesisString(const QKeySequence &sequence)
|
||||
{
|
||||
return QStringLiteral("(%1)").arg(sequence.toString());
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace BlackGui
|
||||
static const QKeySequence &keyFontReset();
|
||||
|
||||
//! As string for menus etc. Looks like "(CTRL + R)"
|
||||
static const QString toParenthesisString(const QKeySequence &sequence);
|
||||
static QString toParenthesisString(const QKeySequence &sequence);
|
||||
};
|
||||
} // ns
|
||||
#endif // guard
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace BlackGui
|
||||
int CApplicationInfoView::otherSwiftVersionsFromDataDirectories(bool reinitOtherVersions)
|
||||
{
|
||||
const CApplicationInfoList others = CApplicationInfoList::fromOtherSwiftVersionsFromDataDirectories(reinitOtherVersions);
|
||||
m_acceptRowSelection = (others.size() > 0);
|
||||
m_acceptRowSelection = (!others.isEmpty());
|
||||
|
||||
this->updateContainer(others);
|
||||
return others.size();
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace BlackInput
|
||||
return hr;
|
||||
}
|
||||
|
||||
if (m_joystickDevices.empty())
|
||||
if (m_joystickDevices.isEmpty())
|
||||
{
|
||||
CLogMessage(this).info(u"No joystick device found");
|
||||
}
|
||||
|
||||
@@ -102,6 +102,6 @@ namespace BlackMisc
|
||||
|
||||
bool CApplicationInfoList::hasOtherSwiftDataDirectories()
|
||||
{
|
||||
return applicationDataDirectoryMapWithoutCurrentVersion().size() > 0;
|
||||
return !applicationDataDirectoryMapWithoutCurrentVersion().isEmpty();
|
||||
}
|
||||
} // ns
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace BlackMisc
|
||||
return this->findByNameOrDefault(name, CAudioDeviceInfo(), strict);
|
||||
}
|
||||
|
||||
CAudioDeviceInfo CAudioDeviceInfoList::findByNameOrDefault(const QString &name, const CAudioDeviceInfo defaultDevice, bool strict) const
|
||||
CAudioDeviceInfo CAudioDeviceInfoList::findByNameOrDefault(const QString &name, const CAudioDeviceInfo &defaultDevice, bool strict) const
|
||||
{
|
||||
if (name.isEmpty()) { return defaultDevice; }
|
||||
for (const CAudioDeviceInfo &d : *this)
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace BlackMisc
|
||||
CAudioDeviceInfo findByName(const QString &name, bool strict = false) const;
|
||||
|
||||
//! Find by name
|
||||
CAudioDeviceInfo findByNameOrDefault(const QString &name, const CAudioDeviceInfo defaultDevice, bool strict = false) const;
|
||||
CAudioDeviceInfo findByNameOrDefault(const QString &name, const CAudioDeviceInfo &defaultDevice, bool strict = false) const;
|
||||
|
||||
//! Find by host name
|
||||
CAudioDeviceInfoList findByHostName(const QString &hostName) const;
|
||||
|
||||
@@ -28,12 +28,9 @@ namespace BlackMisc
|
||||
static const QString supMsg("supervisor msg.");
|
||||
static const QString unicomMsg("unicom msg.");
|
||||
static const QString mentioned("cs mentioned");
|
||||
static const QString joined("room joined");
|
||||
static const QString left("room left");
|
||||
static const QString pttUp("PTT click up");
|
||||
static const QString pttDown("PTT click down");
|
||||
static const QString pttBlocked("PTT blocked");
|
||||
static const QString load("load sounds");
|
||||
static const QString noaudiotx("No audio tx");
|
||||
static const QString afvclick("AFC click");
|
||||
static const QString afvblock("AFV blocked");
|
||||
@@ -64,7 +61,7 @@ namespace BlackMisc
|
||||
return unknown;
|
||||
}
|
||||
|
||||
const QString CNotificationSounds::toString(Notification notification)
|
||||
QString CNotificationSounds::toString(Notification notification)
|
||||
{
|
||||
QStringList n;
|
||||
if (notification.testFlag(NotificationError)) n << flagToString(NotificationError);
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace BlackMisc
|
||||
static const QString &flagToString(NotificationFlag notification);
|
||||
|
||||
//! As string
|
||||
static const QString toString(Notification notification);
|
||||
static QString toString(Notification notification);
|
||||
};
|
||||
} // ns
|
||||
} // ns
|
||||
|
||||
@@ -544,7 +544,7 @@ namespace BlackMisc
|
||||
return this->getOnGroundDetails() != CAircraftSituation::NotSetGroundDetails;
|
||||
}
|
||||
|
||||
const QString CAircraftSituation::getOnGroundDetailsAsString() const
|
||||
const QString &CAircraftSituation::getOnGroundDetailsAsString() const
|
||||
{
|
||||
return CAircraftSituation::onGroundDetailsToString(this->getOnGroundDetails());
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ namespace BlackMisc
|
||||
bool hasGroundDetailsForGndInterpolation() const;
|
||||
|
||||
//! On ground reliability as string
|
||||
const QString getOnGroundDetailsAsString() const;
|
||||
const QString &getOnGroundDetailsAsString() const;
|
||||
|
||||
//! On ground details
|
||||
bool setOnGroundDetails(CAircraftSituation::OnGroundDetails details);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
const QString CAirlineIcaoCode::getVDesignator() const
|
||||
QString CAirlineIcaoCode::getVDesignator() const
|
||||
{
|
||||
if (!this->isVirtualAirline()) { return m_designator; }
|
||||
return u'V' % m_designator;
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackMisc
|
||||
const QString &getDesignator() const { return m_designator; }
|
||||
|
||||
//! Get airline, e.g. "DLH", but "VMVA" for virtual airlines
|
||||
const QString getVDesignator() const;
|
||||
QString getVDesignator() const;
|
||||
|
||||
//! Get VDesignator plus key
|
||||
QString getVDesignatorDbKey() const;
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
CAirlineIcaoCodeList step1Data = airlineName.isEmpty() ? *this : this->findByNamesOrTelephonyDesignator(airlineName);
|
||||
if (step1Data.size() < 1 || step1Data.size() == this->size())
|
||||
if (step1Data.isEmpty() || step1Data.size() == this->size())
|
||||
{
|
||||
if (log) { CCallsign::addLogDetailsToList(log, cs, loginfo % QStringLiteral(" cannot reduce by '%1'").arg(airlineName), getLogCategories()); }
|
||||
step1Data = *this;
|
||||
@@ -231,7 +231,7 @@ namespace BlackMisc
|
||||
if (step1Data.size() == 1) { return step1Data; }
|
||||
|
||||
CAirlineIcaoCodeList step2Data = telephony.isEmpty() ? step1Data : step1Data.findByNamesOrTelephonyDesignator(telephony);
|
||||
if (step2Data.size() < 1 || step2Data.size() == this->size())
|
||||
if (step2Data.isEmpty() || step2Data.size() == this->size())
|
||||
{
|
||||
if (log) { CCallsign::addLogDetailsToList(log, cs, loginfo % QStringLiteral(" cannot reduce by name '%1'").arg(telephony), getLogCategories()); }
|
||||
step2Data = step1Data;
|
||||
@@ -244,7 +244,7 @@ namespace BlackMisc
|
||||
if (step2Data.size() == 1) { return step2Data; }
|
||||
|
||||
CAirlineIcaoCodeList step3Data = countryIso.isEmpty() ? step2Data : step2Data.findByCountryIsoCode(countryIso);
|
||||
if (step3Data.size() < 1 || step3Data.size() == this->size())
|
||||
if (step3Data.isEmpty() || step3Data.size() == this->size())
|
||||
{
|
||||
if (log) { CCallsign::addLogDetailsToList(log, cs, loginfo % QStringLiteral(" cannot reduce by country '%1'").arg(countryIso), getLogCategories()); }
|
||||
step3Data = step2Data;
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace BlackMisc
|
||||
singleShot(0, m_serializer, [this, key] { m_revision.sessionValue(key); });
|
||||
}
|
||||
|
||||
const QString CDataCache::relativeFilePath()
|
||||
const QString &CDataCache::relativeFilePath()
|
||||
{
|
||||
static const QString p("/data/cache/core");
|
||||
return p;
|
||||
|
||||
@@ -292,7 +292,7 @@ namespace BlackMisc
|
||||
void sessionValue(const QString &key);
|
||||
|
||||
//! Relative file path in application data directory
|
||||
static const QString relativeFilePath();
|
||||
static const QString &relativeFilePath();
|
||||
|
||||
private:
|
||||
CDataCache();
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace BlackMisc
|
||||
{
|
||||
const int i = valueWithKey.indexOf('(');
|
||||
if (i < 0) { return valueWithKey.trimmed(); }
|
||||
if (i < 1) { return QStringLiteral(""); }
|
||||
if (i < 1) { return {}; }
|
||||
return valueWithKey.left(i - 1).trimmed();
|
||||
}
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@ namespace BlackMisc
|
||||
return sl;
|
||||
}
|
||||
|
||||
const QSet<QString> CDirectoryUtils::filesToCanonicalNames(const QSet<QString> &fileNames, const QSet<QString> &canonicalFileNames)
|
||||
QSet<QString> CDirectoryUtils::filesToCanonicalNames(const QSet<QString> &fileNames, const QSet<QString> &canonicalFileNames)
|
||||
{
|
||||
CSetBuilder<QString> found;
|
||||
if (fileNames.isEmpty()) return {};
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace BlackMisc
|
||||
static QSet<QString> canonicalFileNamesToQSet(const QFileInfoList &fileInfoList);
|
||||
|
||||
//! File to canonical names
|
||||
static const QSet<QString> filesToCanonicalNames(const QSet<QString> &fileNames, const QSet<QString> &canonicalFileNames);
|
||||
static QSet<QString> filesToCanonicalNames(const QSet<QString> &fileNames, const QSet<QString> &canonicalFileNames);
|
||||
|
||||
//! Can connect the UNC machine
|
||||
static bool canPingUncMachine(const QString &machine);
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace BlackMisc
|
||||
operator CPropertyIndexRef() const;
|
||||
|
||||
//! Copy with first element removed
|
||||
CPropertyIndex copyFrontRemoved() const;
|
||||
Q_REQUIRED_RESULT CPropertyIndex copyFrontRemoved() const;
|
||||
|
||||
//! Is nested index?
|
||||
bool isNested() const;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
||||
CPropertyIndexList(const CSequence<CPropertyIndex> &other);
|
||||
|
||||
//! List without front element, or empty list if not applicable
|
||||
CPropertyIndexList copyFrontRemoved() const;
|
||||
Q_REQUIRED_RESULT CPropertyIndexList copyFrontRemoved() const;
|
||||
};
|
||||
} //namespace
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace BlackMisc
|
||||
explicit CPropertyIndexRef(QVector<int> &&) = delete;
|
||||
|
||||
//! Copy with first element removed
|
||||
CPropertyIndexRef copyFrontRemoved() const;
|
||||
Q_REQUIRED_RESULT CPropertyIndexRef copyFrontRemoved() const;
|
||||
|
||||
//! Is nested index?
|
||||
bool isNested() const;
|
||||
|
||||
@@ -418,7 +418,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
//! Reversed order
|
||||
CSequence reversed() const
|
||||
Q_REQUIRED_RESULT CSequence reversed() const
|
||||
{
|
||||
CSequence result = *this;
|
||||
result.reverse();
|
||||
@@ -441,7 +441,7 @@ namespace BlackMisc
|
||||
|
||||
//! Return a copy sorted by a given comparator predicate.
|
||||
template <class Predicate>
|
||||
CSequence sorted(Predicate p) const
|
||||
Q_REQUIRED_RESULT CSequence sorted(Predicate p) const
|
||||
{
|
||||
CSequence result = *this;
|
||||
result.sort(p);
|
||||
@@ -474,7 +474,7 @@ namespace BlackMisc
|
||||
|
||||
//! Return a copy with the smallest n elements at the beginning and sorted.
|
||||
template <class Predicate>
|
||||
CSequence partiallySorted(size_type n, Predicate p) const
|
||||
Q_REQUIRED_RESULT CSequence partiallySorted(size_type n, Predicate p) const
|
||||
{
|
||||
CSequence result = *this;
|
||||
result.partiallySort(n, p);
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace BlackMisc
|
||||
return CFileUtils::appendFilePaths(persistentStore(), instance()->CValueCache::filenameForKey(key));
|
||||
}
|
||||
|
||||
const QString CSettingsCache::relativeFilePath()
|
||||
const QString &CSettingsCache::relativeFilePath()
|
||||
{
|
||||
static const QString p("/settings/core");
|
||||
return p;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackMisc
|
||||
static QString filenameForKey(const QString &key);
|
||||
|
||||
//! Relative file path in application data directory
|
||||
static const QString relativeFilePath();
|
||||
static const QString &relativeFilePath();
|
||||
|
||||
//! Return all files where settings may be stored.
|
||||
QStringList enumerateStore() const;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace BlackMisc
|
||||
|
||||
signals:
|
||||
//! Emitted by request and requestAsync.
|
||||
void requestPosted(const CVariant ¶m, BlackMisc::CPromise<BlackMisc::CVariant> o_reply);
|
||||
void requestPosted(const BlackMisc::CVariant ¶m, BlackMisc::CPromise<BlackMisc::CVariant> o_reply);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace BlackMisc
|
||||
/*!
|
||||
* Server side implementation of IDuplex. Receives messages from clients and forwards them to other clients via the CHub.
|
||||
*/
|
||||
class BLACKMISC_EXPORT CDuplex : public IDuplex
|
||||
class BLACKMISC_EXPORT CDuplex final : public IDuplex
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKMISC_DUPLEX_INTERFACE)
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace BlackMisc
|
||||
/*!
|
||||
* Client side implementation of IDuplex, through which the client communicates with the server.
|
||||
*/
|
||||
class BLACKMISC_EXPORT CDuplexProxy : public IDuplex
|
||||
class BLACKMISC_EXPORT CDuplexProxy final : public IDuplex
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKMISC_DUPLEX_INTERFACE)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace BlackMisc
|
||||
/*!
|
||||
* Server side implementation of IHub. Maintains a collection of CDuplex objects.
|
||||
*/
|
||||
class BLACKMISC_EXPORT CHub : public IHub
|
||||
class BLACKMISC_EXPORT CHub final : public IHub
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKMISC_HUB_INTERFACE)
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace BlackMisc
|
||||
/*!
|
||||
* Client side implementation of IHub.
|
||||
*/
|
||||
class BLACKMISC_EXPORT CHubProxy : public IHub
|
||||
class BLACKMISC_EXPORT CHubProxy final : public IHub
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_CLASSINFO("D-Bus Interface", BLACKMISC_HUB_INTERFACE)
|
||||
|
||||
@@ -303,14 +303,14 @@ namespace BlackMisc
|
||||
return n;
|
||||
}
|
||||
|
||||
const QString CAircraftMatcherSetup::forceToString(ForceMode force)
|
||||
QString CAircraftMatcherSetup::forceToString(ForceMode force)
|
||||
{
|
||||
if (force.testFlag(ForceNothing)) { return QStringLiteral("nothing"); }
|
||||
|
||||
QStringList forces;
|
||||
if (force.testFlag(ForceType)) { forces << forceToString(ForceType); }
|
||||
if (force.testFlag(ForceEnginecount)) { forces << forceToString(ForceEnginecount); }
|
||||
if (force.testFlag(ForceEngine)) { forces << forceToString(ForceEngine); }
|
||||
if (force.testFlag(ForceType)) { forces << forceFlagToString(ForceType); }
|
||||
if (force.testFlag(ForceEnginecount)) { forces << forceFlagToString(ForceEnginecount); }
|
||||
if (force.testFlag(ForceEngine)) { forces << forceFlagToString(ForceEngine); }
|
||||
return forces.join(", ");
|
||||
}
|
||||
|
||||
|
||||
@@ -258,7 +258,7 @@ namespace BlackMisc
|
||||
static const QString &forceFlagToString(ForceModeFlag forceFlag);
|
||||
|
||||
//! Force to string
|
||||
static const QString forceToString(ForceMode force);
|
||||
static QString forceToString(ForceMode force);
|
||||
|
||||
//! Strategy to string
|
||||
static const QString &strategyToString(PickSimilarStrategy strategy);
|
||||
|
||||
@@ -781,7 +781,7 @@ namespace BlackMisc
|
||||
|
||||
QString CAircraftModel::getFileDirectoryPath() const
|
||||
{
|
||||
if (!this->hasFileName()) { return QStringLiteral(""); }
|
||||
if (!this->hasFileName()) { return {}; }
|
||||
return this->getFileDirectory().absolutePath();
|
||||
}
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ namespace BlackMisc
|
||||
CAirlineIcaoCode CAircraftModelList::getAirlineWithMaxCount() const
|
||||
{
|
||||
const QMap<CAirlineIcaoCode, int> ac = this->countPerAirlineIcao();
|
||||
if (ac.size() < 1) { return {}; }
|
||||
if (ac.isEmpty()) { return {}; }
|
||||
if (ac.size() == 1) { return ac.firstKey(); }
|
||||
const QList<int> values = ac.values();
|
||||
const int max = *std::max_element(values.begin(), values.end());
|
||||
@@ -1641,7 +1641,7 @@ namespace BlackMisc
|
||||
return msgs;
|
||||
}
|
||||
|
||||
CStatusMessageList CAircraftModelList::validateUncFiles(const QSet<QString> uncFiles) const
|
||||
CStatusMessageList CAircraftModelList::validateUncFiles(const QSet<QString> &uncFiles) const
|
||||
{
|
||||
// check if UNC paths can be reached
|
||||
CStatusMessageList msgs;
|
||||
|
||||
@@ -567,7 +567,7 @@ namespace BlackMisc
|
||||
|
||||
private:
|
||||
//! Validate UNC paths (Windows)
|
||||
CStatusMessageList validateUncFiles(const QSet<QString> uncFiles) const;
|
||||
CStatusMessageList validateUncFiles(const QSet<QString> &uncFiles) const;
|
||||
};
|
||||
|
||||
//! Model per callsign
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackMisc
|
||||
this->setDbKey(unifyKeyOrAlias(id));
|
||||
}
|
||||
|
||||
const QString CDistributor::getIdAndDescription() const
|
||||
QString CDistributor::getIdAndDescription() const
|
||||
{
|
||||
if (!this->getDbKey().isEmpty() && !this->getDescription().isEmpty())
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace BlackMisc
|
||||
const QString &getDescription() const { return m_description;}
|
||||
|
||||
//! Get id and description
|
||||
const QString getIdAndDescription() const;
|
||||
QString getIdAndDescription() const;
|
||||
|
||||
//! Set description
|
||||
void setDescription(const QString &description) { m_description = description.trimmed(); }
|
||||
|
||||
@@ -477,7 +477,7 @@ namespace BlackMisc
|
||||
if (!correctPath) { continue; }
|
||||
|
||||
// absolute or relative path
|
||||
const QString fp = pathValue.left(3).contains(':') ?
|
||||
const QString fp = pathValue.leftRef(3).contains(':') ?
|
||||
pathValue :
|
||||
CFileUtils::appendFilePaths(addOnPath, pathValue);
|
||||
if (CFsDirectories::logConfigPathReading()) { CLogMessage(static_cast<CFsDirectories *>(nullptr)).info(u"Testing '%1' as addon path: '%2'") << fp << addOnPath; }
|
||||
@@ -562,7 +562,7 @@ namespace BlackMisc
|
||||
if (containsAny(soPath, CFsDirectories::fsxSimObjectsExcludeDirectoryPatterns(), Qt::CaseInsensitive)) { continue; }
|
||||
|
||||
// make absolute
|
||||
if (!soPath.left(3).contains(':')) { soPath = CFileUtils::appendFilePaths(relPath, soPath); }
|
||||
if (!soPath.leftRef(3).contains(':')) { soPath = CFileUtils::appendFilePaths(relPath, soPath); }
|
||||
|
||||
const QDir dir(soPath); // always absolute path now
|
||||
if (checked && !dir.exists())
|
||||
@@ -585,7 +585,7 @@ namespace BlackMisc
|
||||
return paths;
|
||||
}
|
||||
|
||||
const QString CFsDirectories::airFileFilter()
|
||||
const QString &CFsDirectories::airFileFilter()
|
||||
{
|
||||
static const QString a("*.air");
|
||||
return a;
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace BlackMisc
|
||||
static QSet<QString> fsxSimObjectsPaths(const QString &fsxFile, bool checked);
|
||||
|
||||
//! .air file filter
|
||||
static const QString airFileFilter();
|
||||
static const QString &airFileFilter();
|
||||
|
||||
private:
|
||||
//! Utility functions
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace BlackMisc
|
||||
m_typeCode(typeCode.trimmed().toUpper()), m_callsignPrefix(callsignPrefix.trimmed().toUpper()), m_updatedMsSinceEpoch(updated)
|
||||
{ }
|
||||
|
||||
const QString CVPilotModelRule::getDistributor() const
|
||||
QString CVPilotModelRule::getDistributor() const
|
||||
{
|
||||
QString f(this->getFolder().toUpper().simplified());
|
||||
f.replace(" ", "");
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace BlackMisc
|
||||
const QString &getFolder() const { return this->m_folder;}
|
||||
|
||||
//! Distributor derived from folder (hardcoded)
|
||||
const QString getDistributor() const;
|
||||
QString getDistributor() const;
|
||||
|
||||
//! Get type code
|
||||
const QString &getTypeCode() const { return this->m_typeCode;}
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace BlackMisc
|
||||
QSet<QString> removeSet(knownModels.begin(), knownModels.end());
|
||||
removeSet &= QSet<QString>(remove.begin(), remove.end());
|
||||
int c = 0;
|
||||
for (const QString &model : removeSet)
|
||||
for (const QString &model : std::as_const(removeSet))
|
||||
{
|
||||
c += this->removeIf(&CVPilotModelRule::getModelName, model);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace BlackMisc
|
||||
}
|
||||
|
||||
//! Log flag to string
|
||||
const QString matchingLogToString(MatchingLog log)
|
||||
QString matchingLogToString(MatchingLog log)
|
||||
{
|
||||
if (log == MatchingLogNothing) { return matchingLogFlagToString(MatchingLogNothing); }
|
||||
QStringList l;
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace BlackMisc
|
||||
Q_DECLARE_FLAGS(MatchingLog, MatchingLogFlag)
|
||||
|
||||
//! Log flag to string
|
||||
BLACKMISC_EXPORT const QString matchingLogToString(MatchingLog log);
|
||||
BLACKMISC_EXPORT QString matchingLogToString(MatchingLog log);
|
||||
|
||||
//! Log flag to string
|
||||
BLACKMISC_EXPORT const QString &matchingLogFlagToString(MatchingLogFlag logFlag);
|
||||
|
||||
@@ -16,8 +16,8 @@ namespace BlackMisc
|
||||
namespace Simulation
|
||||
{
|
||||
MSInOutValues::MSInOutValues(const CCallsign &cs,
|
||||
const CAircraftIcaoCode aircraftIcao,
|
||||
const CAirlineIcaoCode airlineIcao,
|
||||
const CAircraftIcaoCode &aircraftIcao,
|
||||
const CAirlineIcaoCode &airlineIcao,
|
||||
const QString &livery, int liveryId) :
|
||||
MSInOutValues(cs.asString(), cs.getStringAsSet(), cs.getFlightNumber(),
|
||||
aircraftIcao.getDesignator(), aircraftIcao.getFamily(), aircraftIcao.getCombinedType(), aircraftIcao.getDbKey(),
|
||||
@@ -26,8 +26,8 @@ namespace BlackMisc
|
||||
{ }
|
||||
|
||||
MSInOutValues::MSInOutValues(const CCallsign &cs,
|
||||
const CAircraftIcaoCode aircraftIcao,
|
||||
const CLivery livery) :
|
||||
const CAircraftIcaoCode &aircraftIcao,
|
||||
const CLivery &livery) :
|
||||
MSInOutValues(cs,
|
||||
aircraftIcao,
|
||||
livery.getAirlineIcaoCode(),
|
||||
|
||||
@@ -80,14 +80,14 @@ namespace BlackMisc
|
||||
|
||||
//! Ctor
|
||||
MSInOutValues(const BlackMisc::Aviation::CCallsign &cs,
|
||||
const BlackMisc::Aviation::CAircraftIcaoCode aircraftIcao,
|
||||
const BlackMisc::Aviation::CAirlineIcaoCode airlineIcao,
|
||||
const BlackMisc::Aviation::CAircraftIcaoCode &aircraftIcao,
|
||||
const BlackMisc::Aviation::CAirlineIcaoCode &airlineIcao,
|
||||
const QString &livery, int liveryId);
|
||||
|
||||
//! Ctor
|
||||
MSInOutValues(const BlackMisc::Aviation::CCallsign &cs,
|
||||
const BlackMisc::Aviation::CAircraftIcaoCode aircraftIcao,
|
||||
const BlackMisc::Aviation::CLivery livery);
|
||||
const BlackMisc::Aviation::CAircraftIcaoCode &aircraftIcao,
|
||||
const BlackMisc::Aviation::CLivery &livery);
|
||||
|
||||
//! Ctor
|
||||
MSInOutValues(const BlackMisc::Simulation::CAircraftModel &model);
|
||||
|
||||
@@ -1176,7 +1176,7 @@ namespace BlackMisc
|
||||
// but to make sure we do the search
|
||||
const qint64 ts = partsList.latestTimestampMsecsSinceEpoch() - MaxPartsAgePerCallsignSecs * 1000;
|
||||
partsList.removeBefore(ts);
|
||||
Q_ASSERT_X(partsList.size() >= 1, Q_FUNC_INFO, "Need at least 1 value");
|
||||
Q_ASSERT_X(!partsList.isEmpty(), Q_FUNC_INFO, "Need at least 1 value");
|
||||
}
|
||||
|
||||
const CCallsign &IRemoteAircraftProvider::testAltitudeOffsetCallsign()
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user