iOS: Fix retrieval of developer teams with Qt 6

Qt 6 fixed the representation of certain plist file structures in
QSettings. This leads to a different layout of the QVariantMap that we
get for the information about developer teams.

Fixes: QTCREATORBUG-26111
Task-number: QTCREATORBUG-24098
Change-Id: I18514bda4d9a96bbbf13ed0b7159019778d0862d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2021-10-22 11:40:24 +02:00
parent ddfea6b648
commit c23b2ac7e6

View File

@@ -479,11 +479,17 @@ void IosConfigurations::loadProvisioningData(bool notify)
QList<QVariantMap> teams; QList<QVariantMap> teams;
for (auto accountiterator = teamMap.cbegin(), end = teamMap.cend(); for (auto accountiterator = teamMap.cbegin(), end = teamMap.cend();
accountiterator != end; ++accountiterator) { accountiterator != end; ++accountiterator) {
QVariantMap teamInfo = accountiterator.value().toMap(); // difference between Qt 5 (map) and Qt 6 (list of maps)
int provisioningTeamIsFree = teamInfo.value(freeTeamTag).toBool() ? 1 : 0; const bool isList = accountiterator->userType() == QMetaType::QVariantList;
teamInfo[freeTeamTag] = provisioningTeamIsFree; const QVariantList teamsList = isList ? accountiterator.value().toList()
teamInfo[emailTag] = accountiterator.key(); : QVariantList({accountiterator.value()});
teams.append(teamInfo); for (const QVariant &teamInfoIt : teamsList) {
QVariantMap teamInfo = teamInfoIt.toMap();
int provisioningTeamIsFree = teamInfo.value(freeTeamTag).toBool() ? 1 : 0;
teamInfo[freeTeamTag] = provisioningTeamIsFree;
teamInfo[emailTag] = accountiterator.key();
teams.append(teamInfo);
}
} }
// Sort team id's to move the free provisioning teams at last of the list. // Sort team id's to move the free provisioning teams at last of the list.