mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
refs #937 Resolved clazy warnings: miscellaneous.
This commit is contained in:
@@ -30,6 +30,7 @@ namespace BlackMisc
|
||||
QStringList CApplicationInfoList::processNames() const
|
||||
{
|
||||
QStringList names;
|
||||
names.reserve(size());
|
||||
for (const CApplicationInfo &info : *this)
|
||||
{
|
||||
names.append(info.processInfo().processName());
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace BlackMisc
|
||||
|
||||
//! Elevation
|
||||
//! \sa setGeodeticHeight
|
||||
void setElevation(const BlackMisc::Aviation::CAltitude &elevation) { return this->m_position.setGeodeticHeight(elevation); }
|
||||
void setElevation(const BlackMisc::Aviation::CAltitude &elevation) { this->m_position.setGeodeticHeight(elevation); }
|
||||
|
||||
//! Is the airport still active?
|
||||
bool isOperating() const { return m_operating; }
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace BlackMisc
|
||||
this->m_telephonyDesignator = variant.toQString();
|
||||
break;
|
||||
default:
|
||||
return CValueObject::setPropertyByIndex(index, variant);
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ namespace BlackMisc
|
||||
{
|
||||
QList<CFrequency> f;
|
||||
if (!CSelcal::isValidCode(this->m_code)) return f;
|
||||
f.reserve(this->m_code.length());
|
||||
for (int pos = 0; pos < this->m_code.length(); pos++)
|
||||
{
|
||||
f.append(CSelcal::audioFrequencyEquivalent(this->m_code.at(pos)));
|
||||
|
||||
@@ -107,9 +107,14 @@ namespace BlackMisc
|
||||
this->setEntity(static_cast<CEntityFlags::Entity>(variant.toInt()));
|
||||
break;
|
||||
default:
|
||||
return (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) ?
|
||||
IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant) :
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index))
|
||||
{
|
||||
IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant);
|
||||
}
|
||||
else
|
||||
{
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace BlackMisc
|
||||
QStringList list;
|
||||
for (const auto scope : BlackMisc::as_const(jsonStack()))
|
||||
{
|
||||
list.push_back(scope->m_string ? *scope->m_string : scope->m_latin1);
|
||||
list.push_back(scope->m_string ? *scope->m_string : scope->m_latin1); // clazy:exclude=reserve-candidates
|
||||
if (scope->m_index >= 0) { list.back() += "[" % QString::number(scope->m_index) % "]"; }
|
||||
}
|
||||
return list.isEmpty() ? QStringLiteral("<document root>") : list.join('.');
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace BlackMisc
|
||||
QString CRoleList::namesAsString(const QString &separator) const
|
||||
{
|
||||
QStringList rolesString;
|
||||
rolesString.reserve(size());
|
||||
for (const CRole &role : (*this))
|
||||
{
|
||||
rolesString.append(role.getName());
|
||||
|
||||
@@ -605,6 +605,7 @@ namespace BlackMisc
|
||||
QStringList CAircraftModelList::toCompleterStrings(bool sorted) const
|
||||
{
|
||||
QStringList c;
|
||||
c.reserve(size());
|
||||
for (const CAircraftModel &model : *this)
|
||||
{
|
||||
c.append(model.getModelString());
|
||||
|
||||
@@ -51,6 +51,7 @@ namespace BlackMisc
|
||||
QStringList CVPilotModelRuleSet::toUpper(const QStringList &stringList)
|
||||
{
|
||||
QStringList upper;
|
||||
upper.reserve(stringList.size());
|
||||
for (const QString &s : stringList)
|
||||
{
|
||||
upper.append(s.toUpper());
|
||||
@@ -61,6 +62,7 @@ namespace BlackMisc
|
||||
QStringList CVPilotModelRuleSet::getSortedModelNames() const
|
||||
{
|
||||
QStringList ms;
|
||||
ms.reserve(size());
|
||||
for (const CVPilotModelRule &rule : (*this))
|
||||
{
|
||||
ms.append(rule.getModelName());
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackMisc
|
||||
void CRemoteAircraftAware::updateMarkAllAsNotRendered()
|
||||
{
|
||||
Q_ASSERT_X(this->m_remoteAircraftProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_remoteAircraftProvider->updateMarkAllAsNotRendered();
|
||||
this->m_remoteAircraftProvider->updateMarkAllAsNotRendered();
|
||||
}
|
||||
|
||||
bool CRemoteAircraftAware::isRemoteAircraftSupportingParts(const CCallsign &callsign) const
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace BlackMisc
|
||||
while (!ts.atEnd())
|
||||
{
|
||||
QString pathToCheck = ts.readLine();
|
||||
if (QFileInfo(pathToCheck).exists()) { lastLine = pathToCheck; }
|
||||
if (QFileInfo::exists(pathToCheck)) { lastLine = pathToCheck; }
|
||||
}
|
||||
return lastLine;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace BlackMisc
|
||||
{
|
||||
CTestBase::CTestBase(int argc, const char *const *argv)
|
||||
{
|
||||
m_arguments.reserve(argc);
|
||||
for (int i = 0; i < argc; ++i)
|
||||
{
|
||||
m_arguments.append(argv[i]);
|
||||
|
||||
@@ -344,6 +344,7 @@ namespace BlackMisc
|
||||
{
|
||||
if (m_verbose) out() << "Pid: " << CTestService::getPid() << " getObjectPaths" << endl;
|
||||
QList<QDBusObjectPath> paths;
|
||||
paths.reserve(n);
|
||||
for (int i = 0; i < n; i++)
|
||||
{
|
||||
paths.append(QDBusObjectPath(ObjectPath()));
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace BlackMisc
|
||||
const BlackMisc::CSlot<void(const BlackMisc::Weather::CWeatherGrid &)> &callback)
|
||||
{
|
||||
Q_ASSERT_X(this->m_weatherGridProvider, Q_FUNC_INFO, "No object available");
|
||||
return this->m_weatherGridProvider->requestWeatherGrid(weatherGrid, callback);
|
||||
this->m_weatherGridProvider->requestWeatherGrid(weatherGrid, callback);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user