mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 10:47:01 +08:00
Fixed clazy warnings: pass large objects by reference to const.
This commit is contained in:
@@ -142,13 +142,13 @@ namespace BlackGui
|
||||
ui->tvp_StashAircraftModels->updateContainerMaybeAsync(models);
|
||||
}
|
||||
|
||||
int CDbStashComponent::unstashModels(QSet<int> keys)
|
||||
int CDbStashComponent::unstashModels(const QSet<int> &keys)
|
||||
{
|
||||
if (keys.isEmpty()) { return 0; }
|
||||
return ui->tvp_StashAircraftModels->removeDbKeys(keys);
|
||||
}
|
||||
|
||||
int CDbStashComponent::unstashModels(QStringList modelStrings)
|
||||
int CDbStashComponent::unstashModels(const QStringList &modelStrings)
|
||||
{
|
||||
if (modelStrings.isEmpty()) { return 0; }
|
||||
return ui->tvp_StashAircraftModels->removeModelsWithModelString(modelStrings);
|
||||
|
||||
@@ -74,10 +74,10 @@ namespace BlackGui
|
||||
BlackMisc::CStatusMessage validateStashModel(const BlackMisc::Simulation::CAircraftModel &model, bool allowReplace) const;
|
||||
|
||||
//! Unstash given models with keys
|
||||
int unstashModels(QSet<int> keys);
|
||||
int unstashModels(const QSet<int> &keys);
|
||||
|
||||
//! Unstash given models by model string
|
||||
int unstashModels(QStringList modelStrings);
|
||||
int unstashModels(const QStringList &modelStrings);
|
||||
|
||||
//! Unstash given models
|
||||
int unstashModels(const BlackMisc::Simulation::CAircraftModelList &models);
|
||||
|
||||
@@ -179,7 +179,7 @@ namespace BlackGui
|
||||
ui->tw_SpecializedViews->setCurrentIndex(tabIndex);
|
||||
}
|
||||
|
||||
CAircraftModelList CMappingComponent::findModelsStartingWith(const QString modelName, Qt::CaseSensitivity cs)
|
||||
CAircraftModelList CMappingComponent::findModelsStartingWith(const QString &modelName, Qt::CaseSensitivity cs)
|
||||
{
|
||||
Q_ASSERT(ui->tvp_AircraftModels);
|
||||
return ui->tvp_AircraftModels->container().findModelsStartingWith(modelName, cs);
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace BlackGui
|
||||
void setTab(TabWidget tab);
|
||||
|
||||
//! Find models starting with
|
||||
BlackMisc::Simulation::CAircraftModelList findModelsStartingWith(const QString modelName, Qt::CaseSensitivity cs);
|
||||
BlackMisc::Simulation::CAircraftModelList findModelsStartingWith(const QString &modelName, Qt::CaseSensitivity cs);
|
||||
|
||||
signals:
|
||||
//! Request a text message
|
||||
|
||||
@@ -293,7 +293,7 @@ namespace BlackGui
|
||||
styleSheet;
|
||||
}
|
||||
|
||||
bool CTextMessageComponent::isCorrespondingTextMessageTabSelected(CTextMessage textMessage) const
|
||||
bool CTextMessageComponent::isCorrespondingTextMessageTabSelected(const CTextMessage &textMessage) const
|
||||
{
|
||||
if (!this->isVisibleWidgetHack()) { return false; }
|
||||
if (!textMessage.hasValidRecipient()) { return false; }
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace BlackGui
|
||||
void displayInInfoWindow(const BlackMisc::CVariant &message, int displayDurationMs) const;
|
||||
|
||||
//! Command line was entered
|
||||
void commandEntered(const QString commandLine, const BlackMisc::CIdentifier &originator);
|
||||
void commandEntered(const QString &commandLine, const BlackMisc::CIdentifier &originator);
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CTextMessageComponent> ui;
|
||||
@@ -137,7 +137,7 @@ namespace BlackGui
|
||||
BlackMisc::Simulation::CSimulatedAircraft getOwnAircraft() const;
|
||||
|
||||
//! For this text message's recepient, is the current tab selected?
|
||||
bool isCorrespondingTextMessageTabSelected(BlackMisc::Network::CTextMessage textMessage) const;
|
||||
bool isCorrespondingTextMessageTabSelected(const BlackMisc::Network::CTextMessage &textMessage) const;
|
||||
|
||||
//! Network connected?
|
||||
bool isNetworkConnected() const;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace BlackGui
|
||||
Q_UNUSED(paintEvent);
|
||||
}
|
||||
|
||||
void CValidationIndicator::setBackgroundColor(const QString colorName)
|
||||
void CValidationIndicator::setBackgroundColor(const QString &colorName)
|
||||
{
|
||||
if (colorName.isEmpty())
|
||||
{
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace BlackGui
|
||||
QScopedPointer<Ui::CValidationIndicator> ui;
|
||||
|
||||
//! Set background color
|
||||
void setBackgroundColor(const QString colorName);
|
||||
void setBackgroundColor(const QString &colorName);
|
||||
|
||||
QTimer m_resetTimer; //!< reset to neutral
|
||||
QString m_originalStyleSheet; //!< stored, to be able to reset
|
||||
|
||||
@@ -259,7 +259,7 @@ namespace BlackGui
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
CValueObjectFormatter(int alignment = alignDefault(), bool i18n = true, QList<int> supportedRoles = roleDisplay()) : CDefaultFormatter(alignment, i18n, supportedRoles) {}
|
||||
CValueObjectFormatter(int alignment = alignDefault(), bool i18n = true, const QList<int> &supportedRoles = roleDisplay()) : CDefaultFormatter(alignment, i18n, supportedRoles) {}
|
||||
|
||||
//! \copydoc CDefaultFormatter::displayRole
|
||||
virtual BlackMisc::CVariant displayRole(const BlackMisc::CVariant &valueObject) const override;
|
||||
@@ -344,7 +344,7 @@ namespace BlackGui
|
||||
{
|
||||
public:
|
||||
//! Constructor
|
||||
CPhysiqalQuantiyFormatter(MU unit = MU::defaultUnit(), int digits = 2, int alignment = alignRightVCenter(), bool withUnit = true, bool i18n = true, QList<int> supportedRoles = roleDisplay()) : CValueObjectFormatter(alignment, i18n, supportedRoles), m_unit(unit), m_digits(digits), m_withUnit(withUnit) {}
|
||||
CPhysiqalQuantiyFormatter(MU unit = MU::defaultUnit(), int digits = 2, int alignment = alignRightVCenter(), bool withUnit = true, bool i18n = true, const QList<int> &supportedRoles = roleDisplay()) : CValueObjectFormatter(alignment, i18n, supportedRoles), m_unit(unit), m_digits(digits), m_withUnit(withUnit) {}
|
||||
|
||||
//! \copydoc BlackGui::Models::CDefaultFormatter::displayRole
|
||||
virtual BlackMisc::CVariant displayRole(const BlackMisc::CVariant &physicalQuantity) const override
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace BlackGui
|
||||
{
|
||||
if (messages.isEmpty()) { return ""; }
|
||||
QString html("<table>");
|
||||
for (CTextMessage msg : messages)
|
||||
for (const CTextMessage &msg : messages)
|
||||
{
|
||||
html += toHtml(msg, withFrom, withTo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user