mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
Fixed clazy warnings: unnecessary containers and containers being detached in range-for loops.
This commit is contained in:
@@ -420,12 +420,12 @@ namespace BlackGui
|
||||
{
|
||||
ui->cb_OtherVersions->clear();
|
||||
const QMap<QString, CApplicationInfo> otherVersions = CDirectoryUtils::currentApplicationDataDirectoryMapWithoutCurrentVersion();
|
||||
for (const QString &directory : otherVersions.keys())
|
||||
for (const auto &pair : makePairsRange(otherVersions))
|
||||
{
|
||||
const CApplicationInfo info(otherVersions.value(directory));
|
||||
const CApplicationInfo &info(pair.second);
|
||||
if (info.isNull())
|
||||
{
|
||||
const QString infoString = CDirectoryUtils::decodeNormalizedDirectory(directory);
|
||||
const QString infoString = CDirectoryUtils::decodeNormalizedDirectory(pair.first);
|
||||
ui->cb_OtherVersions->addItem(infoString);
|
||||
}
|
||||
else
|
||||
@@ -433,7 +433,7 @@ namespace BlackGui
|
||||
static const QString item("swift %1 (%2)");
|
||||
ui->cb_OtherVersions->addItem(item.arg(info.getVersionString(), info.getPlatform()));
|
||||
}
|
||||
m_otherVersionDirs.push_back(directory);
|
||||
m_otherVersionDirs.push_back(pair.first);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace BlackGui
|
||||
{
|
||||
ui->setupUi(this);
|
||||
m_allCheckBoxes = this->findChildren<QCheckBox *>(QString(), Qt::FindDirectChildrenOnly);
|
||||
for (QCheckBox *cb : m_allCheckBoxes)
|
||||
for (QCheckBox *cb : as_const(m_allCheckBoxes))
|
||||
{
|
||||
connect(cb, &QCheckBox::stateChanged, this, &CInterpolationSetupForm::onCheckboxChanged);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::adjustSizeForAllDockWidgets()
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
dw->adjustSize();
|
||||
}
|
||||
@@ -337,7 +337,7 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::floatAllWidgets()
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
if (dw->isFloating()) { continue; }
|
||||
dw->toggleFloating();
|
||||
@@ -346,7 +346,7 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::allFloatingOnTop()
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
const bool f = dw->isFloating();
|
||||
CGuiUtility::stayOnTop(f, dw);
|
||||
@@ -479,11 +479,11 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::displayStatusMessage(const CStatusMessage &statusMessage)
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
dw->displayStatusMessage(statusMessage);
|
||||
}
|
||||
for (CInfoArea *ia : m_childInfoAreas)
|
||||
for (CInfoArea *ia : as_const(m_childInfoAreas))
|
||||
{
|
||||
ia->displayStatusMessage(statusMessage);
|
||||
}
|
||||
@@ -491,11 +491,11 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::displayStatusMessages(const CStatusMessageList &statusMessages)
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
dw->displayStatusMessages(statusMessages);
|
||||
}
|
||||
for (CInfoArea *ia : m_childInfoAreas)
|
||||
for (CInfoArea *ia : as_const(m_childInfoAreas))
|
||||
{
|
||||
ia->displayStatusMessages(statusMessages);
|
||||
}
|
||||
@@ -503,7 +503,7 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::setDockArea(Qt::DockWidgetArea area)
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
Qt::DockWidgetAreas newAreas = static_cast<Qt::DockWidgetAreas>(area);
|
||||
Qt::DockWidgetAreas oldAreas = dw->allowedAreas();
|
||||
@@ -624,7 +624,7 @@ namespace BlackGui
|
||||
void CInfoArea::unTabifyAllWidgets()
|
||||
{
|
||||
if (m_dockWidgetInfoAreas.size() < 2) return;
|
||||
CDockWidgetInfoArea *first = m_dockWidgetInfoAreas.first();
|
||||
CDockWidgetInfoArea *first = m_dockWidgetInfoAreas.constFirst();
|
||||
for (int i = 1; i < m_dockWidgetInfoAreas.size(); i++)
|
||||
{
|
||||
CDockWidgetInfoArea *after = m_dockWidgetInfoAreas.at(i);
|
||||
@@ -641,7 +641,7 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::connectTopLevelChanged()
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
connect(dw, &CDockWidgetInfoArea::widgetTopLevelChanged, this, &CInfoArea::onWidgetTopLevelChanged);
|
||||
}
|
||||
@@ -753,7 +753,7 @@ namespace BlackGui
|
||||
|
||||
void CInfoArea::setFeaturesForDockableWidgets(QDockWidget::DockWidgetFeatures features)
|
||||
{
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
dw->setFeatures(features);
|
||||
}
|
||||
@@ -826,7 +826,7 @@ namespace BlackGui
|
||||
{
|
||||
if (show == m_showTabTexts) { return; }
|
||||
m_showTabTexts = show;
|
||||
for (CDockWidgetInfoArea *dw : m_dockWidgetInfoAreas)
|
||||
for (CDockWidgetInfoArea *dw : as_const(m_dockWidgetInfoAreas))
|
||||
{
|
||||
dw->showTitleWhenDocked(show);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace BlackGui
|
||||
QList<QAction *> CMenuActions::getQActions() const
|
||||
{
|
||||
QList<QAction *> qActions;
|
||||
for (const CMenuAction &a : this->toQList())
|
||||
for (const CMenuAction &a : m_actions)
|
||||
{
|
||||
qActions.append(a.getQAction());
|
||||
}
|
||||
@@ -243,7 +243,7 @@ namespace BlackGui
|
||||
{
|
||||
CMenuAction a;
|
||||
CMenuActions menuActions;
|
||||
for (const CMenuAction &action : actions.toQList())
|
||||
for (const CMenuAction &action : actions.m_actions)
|
||||
{
|
||||
a = this->addAction(action);
|
||||
menuActions.addAction(a);
|
||||
@@ -431,7 +431,7 @@ namespace BlackGui
|
||||
CMenuActions::operator QList<QAction *>() const
|
||||
{
|
||||
QList<QAction *> qActions;
|
||||
for (const CMenuAction &a : toQList())
|
||||
for (const CMenuAction &a : m_actions)
|
||||
{
|
||||
if (!a.getQAction()) { continue; }
|
||||
qActions.append(a.getQAction());
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BlackGui
|
||||
QStandardItemModel::clear();
|
||||
|
||||
int visibleColumns = 0;
|
||||
for (const QString &suffix : m_suffixes)
|
||||
for (const QString &suffix : as_const(m_suffixes))
|
||||
{
|
||||
// ownership of QStandardItem is taken by model
|
||||
QStandardItem *typeFolderFirstColumn = new QStandardItem(CCallsign::atcSuffixToIcon(suffix).toQIcon(), suffix);
|
||||
|
||||
Reference in New Issue
Block a user