mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-09 13:35:34 +08:00
refs #937 Resolved clazy warnings: pass-by-value/reference.
This commit is contained in:
@@ -151,7 +151,7 @@ namespace BlackCore
|
||||
virtual int getModelSetCount() const = 0;
|
||||
|
||||
//! Models for model string
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString modelString) const = 0;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const = 0;
|
||||
|
||||
//! Model strings
|
||||
virtual QStringList getModelSetStrings() const = 0;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackCore
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::getModelSetModelsStartingWith
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString modelString) const override
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override
|
||||
{
|
||||
Q_UNUSED(modelString);
|
||||
logEmptyContextWarning(Q_FUNC_INFO);
|
||||
|
||||
@@ -183,7 +183,7 @@ namespace BlackCore
|
||||
return getModelSet().size();
|
||||
}
|
||||
|
||||
CAircraftModelList CContextSimulator::getModelSetModelsStartingWith(const QString modelString) const
|
||||
CAircraftModelList CContextSimulator::getModelSetModelsStartingWith(const QString &modelString) const
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << modelString; }
|
||||
if (m_simulatorPlugin.first.isUnspecified())
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace BlackCore
|
||||
virtual QStringList getModelSetStrings() const override;
|
||||
virtual QStringList getModelSetCompleterStrings(bool sorted) const override;
|
||||
virtual int getModelSetCount() const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString modelString) const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override;
|
||||
virtual BlackMisc::PhysicalQuantities::CTime getTimeSynchronizationOffset() const override;
|
||||
virtual bool setTimeSynchronization(bool enable, const BlackMisc::PhysicalQuantities::CTime &offset) override;
|
||||
virtual bool isTimeSynchronized() const override;
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace BlackCore
|
||||
return m_dBusInterface->callDBusRet<QStringList>(QLatin1String("getModelSetCompleterStrings"), sorted);
|
||||
}
|
||||
|
||||
CAircraftModelList CContextSimulatorProxy::getModelSetModelsStartingWith(const QString modelString) const
|
||||
CAircraftModelList CContextSimulatorProxy::getModelSetModelsStartingWith(const QString &modelString) const
|
||||
{
|
||||
return m_dBusInterface->callDBusRet<BlackMisc::Simulation::CAircraftModelList>(QLatin1String("getModelSetModelsStartingWith"), modelString);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace BlackCore
|
||||
virtual BlackMisc::Simulation::CSimulatorInfo simulatorsWithInitializedModelSet() const override;
|
||||
virtual QStringList getModelSetStrings() const override;
|
||||
virtual QStringList getModelSetCompleterStrings(bool sorted) const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString modelString) const override;
|
||||
virtual BlackMisc::Simulation::CAircraftModelList getModelSetModelsStartingWith(const QString &modelString) const override;
|
||||
virtual int getModelSetCount() const override;
|
||||
virtual BlackMisc::Simulation::CSimulatorInternals getSimulatorInternals() const override;
|
||||
virtual bool setTimeSynchronization(bool enable, const BlackMisc::PhysicalQuantities::CTime &offset) override;
|
||||
|
||||
@@ -318,7 +318,7 @@ namespace BlackCore
|
||||
return m_sharedFileResponses[entity].getLastModifiedTimestamp();
|
||||
}
|
||||
|
||||
bool CDatabaseReader::requestHeadersOfSharedFiles(const CEntityFlags::Entity &entities)
|
||||
bool CDatabaseReader::requestHeadersOfSharedFiles(CEntityFlags::Entity entities)
|
||||
{
|
||||
if (!this->isNetworkAccessible())
|
||||
{
|
||||
|
||||
@@ -204,7 +204,7 @@ namespace BlackCore
|
||||
BlackMisc::Network::CEntityFlags::Entity getEntitesWithNewerHeaderTimestamp(BlackMisc::Network::CEntityFlags::Entity entities) const;
|
||||
|
||||
//! Request header of shared file
|
||||
bool requestHeadersOfSharedFiles(const BlackMisc::Network::CEntityFlags::Entity &entities);
|
||||
bool requestHeadersOfSharedFiles(BlackMisc::Network::CEntityFlags::Entity entities);
|
||||
|
||||
//! Count from info objects
|
||||
//! \sa BlackCore::Db::CInfoDataReader
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace BlackCore
|
||||
void CInputManager::ps_changeHotkeySettings()
|
||||
{
|
||||
m_configuredActions.clear();
|
||||
for (CActionHotkey actionHotkey : m_actionHotkeys.getThreadLocal())
|
||||
for (const CActionHotkey &actionHotkey : m_actionHotkeys.getThreadLocal())
|
||||
{
|
||||
if (!actionHotkey.getApplicableMachine().isFromLocalMachine()) { continue; }
|
||||
CHotkeyCombination combination = actionHotkey.getCombination();
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace BlackCore
|
||||
return m_instanceIds.value(instance, QString());
|
||||
}
|
||||
|
||||
bool IPluginManager::tryLoad(QString path)
|
||||
bool IPluginManager::tryLoad(const QString &path)
|
||||
{
|
||||
if (!QLibrary::isLibrary(path))
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace BlackCore
|
||||
|
||||
private:
|
||||
//! Tries to load the given plugin.
|
||||
bool tryLoad(QString path);
|
||||
bool tryLoad(const QString &path);
|
||||
|
||||
//! Loads the given plugin (if necessary) and returns its instance.
|
||||
//! Returns `nullptr` on failure.
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
CTokenBucket::CTokenBucket(int capacity, BlackMisc::PhysicalQuantities::CTime interval, int numTokensToRefill)
|
||||
CTokenBucket::CTokenBucket(int capacity, const BlackMisc::PhysicalQuantities::CTime &interval, int numTokensToRefill)
|
||||
: m_capacity(capacity), m_interval(interval), m_numTokensToRefill(numTokensToRefill) {}
|
||||
|
||||
bool CTokenBucket::tryConsume(int numTokens)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace BlackCore
|
||||
{
|
||||
public:
|
||||
//! Constructor for given replenishment policy
|
||||
CTokenBucket(int capacity, BlackMisc::PhysicalQuantities::CTime interval, int numTokensToRefill);
|
||||
CTokenBucket(int capacity, const BlackMisc::PhysicalQuantities::CTime &interval, int numTokensToRefill);
|
||||
|
||||
//! Try to consume a number of tokens
|
||||
bool tryConsume(int numTokens = 1);
|
||||
|
||||
@@ -278,7 +278,7 @@ namespace BlackCore
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray CNetworkVatlib::toFSD(QString qstr) const
|
||||
QByteArray CNetworkVatlib::toFSD(const QString &qstr) const
|
||||
{
|
||||
Q_ASSERT_X(m_fsdTextCodec, Q_FUNC_INFO, "Missing codec");
|
||||
return m_fsdTextCodec->fromUnicode(qstr);
|
||||
@@ -289,7 +289,7 @@ namespace BlackCore
|
||||
return toFSD(callsign.getStringAsSet());
|
||||
}
|
||||
|
||||
std::function<const char **()> CNetworkVatlib::toFSD(QStringList qstrList) const
|
||||
std::function<const char **()> CNetworkVatlib::toFSD(const QStringList &qstrList) const
|
||||
{
|
||||
QVector<QByteArray> bytesVec;
|
||||
for (auto i = qstrList.cbegin(); i != qstrList.cend(); ++i)
|
||||
|
||||
@@ -163,9 +163,9 @@ namespace BlackCore
|
||||
static void onCustomPacketReceived(VatSessionID, const char *callsign, const char *packetId, const char **data, int dataSize, void *cbvar);
|
||||
//! @}
|
||||
|
||||
QByteArray toFSD(QString qstr) const;
|
||||
QByteArray toFSD(const QString &qstr) const;
|
||||
QByteArray toFSD(const BlackMisc::Aviation::CCallsign &callsign) const;
|
||||
std::function<const char **()> toFSD(QStringList qstrList) const;
|
||||
std::function<const char **()> toFSD(const QStringList &qstrList) const;
|
||||
QString fromFSD(const char *cstr) const;
|
||||
QStringList fromFSD(const char **cstrArray, int size) const;
|
||||
bool isInterimPositionUpdateEnabledForServer() const;
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace BlackCore
|
||||
Section section = SectionNone;
|
||||
|
||||
QString currentLine; // declared outside of the for loop, to amortize the cost of allocation
|
||||
for (QStringRef clRef : lines)
|
||||
for (const QStringRef &clRef : lines)
|
||||
{
|
||||
if (this->isAbandoned())
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ namespace BlackCore
|
||||
CUrlList metarFileUrls;
|
||||
|
||||
QString currentLine; // declared outside of the for loop, to amortize the cost of allocation
|
||||
for (QStringRef clRef : lines)
|
||||
for (const QStringRef &clRef : lines)
|
||||
{
|
||||
if (this->isAbandoned())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user