mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-27 19:25:49 +08:00
Use structured bindings (C++17 feature)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user