Use structured bindings (C++17 feature)

This commit is contained in:
Mat Sutcliffe
2021-04-17 16:31:39 +01:00
parent 9964f44d25
commit 22301c1a1f
6 changed files with 18 additions and 23 deletions

View File

@@ -420,19 +420,18 @@ namespace BlackGui
{
ui->cb_OtherVersions->clear();
const QMap<QString, CApplicationInfo> otherVersions = CApplicationInfoList::currentApplicationDataDirectoryMapWithoutCurrentVersion();
for (const auto pair : makePairsRange(otherVersions))
for (const auto [dir, info] : makePairsRange(otherVersions))
{
const CApplicationInfo &info(pair.second);
if (info.isNull())
{
const QString infoString = CDirectoryUtils::decodeNormalizedDirectory(pair.first);
const QString infoString = CDirectoryUtils::decodeNormalizedDirectory(dir);
ui->cb_OtherVersions->addItem(infoString);
}
else
{
ui->cb_OtherVersions->addItem(QStringLiteral("swift %1 (%2)").arg(info.getVersionString(), info.getPlatform()));
}
m_otherVersionDirs.push_back(pair.first);
m_otherVersionDirs.push_back(dir);
}
}