mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Misc. style issues interpolation/model adding
This commit is contained in:
@@ -927,28 +927,19 @@ namespace BlackMisc
|
||||
|
||||
if (!aircraftIcao.isLoadedFromDb())
|
||||
{
|
||||
if (idAircraftIcao >= 0)
|
||||
{
|
||||
aircraftIcao.setDbKey(idAircraftIcao);
|
||||
}
|
||||
if (idAircraftIcao >= 0) { aircraftIcao.setDbKey(idAircraftIcao); }
|
||||
}
|
||||
|
||||
if (!livery.isLoadedFromDb())
|
||||
{
|
||||
const int idLivery = json.value(prefix % QStringLiteral("idlivery")).toInt(-1);
|
||||
if (idLivery >= 0)
|
||||
{
|
||||
livery.setDbKey(idLivery);
|
||||
}
|
||||
if (idLivery >= 0) { livery.setDbKey(idLivery); }
|
||||
}
|
||||
|
||||
if (!distributor.isLoadedFromDb())
|
||||
{
|
||||
const QString idDistributor = json.value(prefix % QStringLiteral("iddistributor")).toString();
|
||||
if (!idDistributor.isEmpty())
|
||||
{
|
||||
distributor.setDbKey(idDistributor);
|
||||
}
|
||||
if (!idDistributor.isEmpty()) { distributor.setDbKey(idDistributor); }
|
||||
}
|
||||
|
||||
if (!cachedAircraftIcao && aircraftIcao.isLoadedFromDb()) { aircraftIcaos[aircraftIcao.getDbKey()] = aircraftIcao; }
|
||||
|
||||
@@ -217,7 +217,7 @@ namespace BlackMisc
|
||||
|
||||
CAircraftCfgEntriesList CAircraftCfgParser::performParsingOfSingleFile(const QString &fileName, bool &ok, CStatusMessageList &msgs)
|
||||
{
|
||||
// due to the filter we expect only "aircraft.cfg" here
|
||||
// due to the filter we expect only "aircraft.cfg" files here
|
||||
// remark: in a 1st version I have used QSettings to parse to file as ini file
|
||||
// unfortunately some files are malformed which could end up in wrong data
|
||||
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace BlackMisc
|
||||
|
||||
// oldest last, null ignored
|
||||
if (!latest.isNull()) { situations.push_back(latest); }
|
||||
if (!newer.isNull()) { situations.push_back(newer); }
|
||||
if (!newer.isNull()) { situations.push_back(newer); }
|
||||
if (!oldest.isNull()) { situations.push_back(oldest); }
|
||||
|
||||
const bool sorted = situations.isSortedAdjustedLatestFirstWithoutNullPositions();
|
||||
|
||||
@@ -142,13 +142,14 @@ namespace BlackMisc
|
||||
if (m_currentSituations.isEmpty()) { return false; }
|
||||
|
||||
// and use the real values if available
|
||||
// m_s[0] .. oldest -> m_[2] .. latest
|
||||
const CAircraftSituation latest = m_currentSituations.front();
|
||||
if (latest.isNewerThanAdjusted(m_s[1])) { m_s[2] = latest; }
|
||||
const qint64 currentAdjusted = m_s[1].getAdjustedMSecsSinceEpoch();
|
||||
const CAircraftSituation older = m_currentSituations.findObjectBeforeAdjustedOrDefault(currentAdjusted);
|
||||
if (!older.isNull()) { m_s[0] = older; }
|
||||
const qint64 latestAdjusted = m_s[2].getAdjustedMSecsSinceEpoch();
|
||||
const qint64 olderAdjusted = m_s[0].getAdjustedMSecsSinceEpoch();
|
||||
const qint64 olderAdjusted = m_s[0].getAdjustedMSecsSinceEpoch();
|
||||
|
||||
// not having a new situation itself is quite normal,
|
||||
// only if it persits it is critical.
|
||||
|
||||
Reference in New Issue
Block a user