McuSupport: Iterate over target packages directly

The previous code iterates over all packages filtering out every package
that is not in the list of the target.
Instead, the list of target packages can be iterated directly.

Change-Id: I03c9b86b45acca121abe6f2098d6c0e98fc94688
Reviewed-by: Daniele Bortolotti <daniele.bortolotti@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Rainer Keller
2022-10-17 10:28:20 +02:00
parent 9498b736da
commit 98cc93b027

View File

@@ -254,8 +254,8 @@ void McuSupportOptionsWidget::showMcuTargetPackages()
m_packagesLayout->removeRow(0);
}
for (const auto &package : std::as_const(m_options.sdkRepository.packages)) {
if (!mcuTarget->packages().contains(package) || package->label().isEmpty())
for (const auto &package : mcuTarget->packages()) {
if (package->label().isEmpty())
continue;
QWidget *packageWidget = package->widget();
m_packagesLayout->addRow(package->label(), packageWidget);