mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Fix cppcheck and compiler warnings
This commit is contained in:
@@ -633,15 +633,15 @@ namespace BlackMisc
|
||||
// make absolute
|
||||
if (!soPath.left(3).contains(':')) { soPath = CFileUtils::appendFilePaths(relPath, soPath); }
|
||||
|
||||
const QDir p(soPath); // always absolute path now
|
||||
if (checked && !p.exists())
|
||||
const QDir dir(soPath); // always absolute path now
|
||||
if (checked && !dir.exists())
|
||||
{
|
||||
// skip, not existing
|
||||
if (logConfigPathReading()) { CLogMessage(getLogCategories()).info(u"FSX SimObjects path skipped, not existing: '%1' in '%2'") << p.absolutePath() << fsxFile; }
|
||||
if (logConfigPathReading()) { CLogMessage(getLogCategories()).info(u"FSX SimObjects path skipped, not existing: '%1' in '%2'") << dir.absolutePath() << fsxFile; }
|
||||
continue;
|
||||
}
|
||||
|
||||
const QString afp = p.absolutePath().toLower();
|
||||
const QString afp = dir.absolutePath().toLower();
|
||||
if (!CDirectoryUtils::containsFileInDir(afp, airFileFilter(), true))
|
||||
{
|
||||
if (logConfigPathReading()) { CLogMessage(getLogCategories()).info(u"FSX SimObjects path: Skipping '%1' from '%2', no '%3' file") << afp << fsxFile << airFileFilter(); }
|
||||
|
||||
@@ -302,7 +302,7 @@ namespace BlackMisc
|
||||
}
|
||||
else
|
||||
{
|
||||
const qint64 diff = noSituation ? -1 : m_currentTimeMsSinceEpoch - currentSituation.getAdjustedMSecsSinceEpoch();
|
||||
const qint64 diff = m_currentTimeMsSinceEpoch - currentSituation.getAdjustedMSecsSinceEpoch();
|
||||
m = CStatusMessage(this).warning(u"Invalid situation, diff. %1ms #%2 for interpolation reported for '%3' (Interpolant: %4 interpolation: %5)") <<
|
||||
diff << m_invalidSituations << m_callsign.asString() << boolToTrueFalse(isValidInterpolant) << boolToTrueFalse(isValidInterpolation);
|
||||
}
|
||||
@@ -609,10 +609,10 @@ namespace BlackMisc
|
||||
}
|
||||
else
|
||||
{
|
||||
CAircraftModel model = this->getAircraftInRangeForCallsign(m_callsign).getModel();
|
||||
if (model.hasModelString())
|
||||
CAircraftModel foundModel = this->getAircraftInRangeForCallsign(m_callsign).getModel();
|
||||
if (foundModel.hasModelString())
|
||||
{
|
||||
m_model = model;
|
||||
m_model = foundModel;
|
||||
}
|
||||
}
|
||||
this->getAndFetchModelCG(model.getCG());
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace BlackMisc
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CSimulatorSettings::setRecordedGndRadius(CLength &radius)
|
||||
bool CSimulatorSettings::setRecordedGndRadius(const CLength &radius)
|
||||
{
|
||||
if (radius == m_recordedGndRadius) { return false; }
|
||||
m_recordedGndRadius = radius;
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace BlackMisc
|
||||
BlackMisc::PhysicalQuantities::CLength getRecordedGndRadius() const { return m_recordedGndRadius; }
|
||||
|
||||
//! Record GND values with radius
|
||||
bool setRecordedGndRadius(BlackMisc::PhysicalQuantities::CLength &radius);
|
||||
bool setRecordedGndRadius(const BlackMisc::PhysicalQuantities::CLength &radius);
|
||||
|
||||
//! Reset the paths
|
||||
void resetPaths();
|
||||
|
||||
@@ -575,15 +575,15 @@ namespace BlackMisc
|
||||
return false;
|
||||
}
|
||||
|
||||
QFileInfo fileInfo(absoluteTexPath);
|
||||
if (!fileInfo.exists())
|
||||
QFileInfo texFileInfo(absoluteTexPath);
|
||||
if (!texFileInfo.exists())
|
||||
{
|
||||
const CStatusMessage m = CStatusMessage(this).error(u"%1/xsb_aircraft.txt Line %2 : Texture '%3' does not exist.") << path << lineNum << absoluteTexPath;
|
||||
m_loadingMessages.push_back(m);
|
||||
return false;
|
||||
}
|
||||
|
||||
package.planes.back().textureName = fileInfo.completeBaseName();
|
||||
package.planes.back().textureName = texFileInfo.completeBaseName();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user