diff options
author | Eike Ziller <eike.ziller@qt.io> | 2021-10-22 11:40:24 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2021-10-26 12:44:16 +0000 |
commit | c23b2ac7e65bf04239fe3f2d390d67fc98b7b3f0 (patch) | |
tree | aacdc04b3935308d309efb7e690b90d5921065ee | |
parent | ddfea6b648c1044cbd06f42389abc2482b66c6b8 (diff) |
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>
-rw-r--r-- | src/plugins/ios/iosconfigurations.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/plugins/ios/iosconfigurations.cpp b/src/plugins/ios/iosconfigurations.cpp index 1b7be13f81..cf137c68bc 100644 --- a/src/plugins/ios/iosconfigurations.cpp +++ b/src/plugins/ios/iosconfigurations.cpp @@ -479,11 +479,17 @@ void IosConfigurations::loadProvisioningData(bool notify) QList<QVariantMap> teams; for (auto accountiterator = teamMap.cbegin(), end = teamMap.cend(); accountiterator != end; ++accountiterator) { - QVariantMap teamInfo = accountiterator.value().toMap(); - int provisioningTeamIsFree = teamInfo.value(freeTeamTag).toBool() ? 1 : 0; - teamInfo[freeTeamTag] = provisioningTeamIsFree; - teamInfo[emailTag] = accountiterator.key(); - teams.append(teamInfo); + // difference between Qt 5 (map) and Qt 6 (list of maps) + const bool isList = accountiterator->userType() == QMetaType::QVariantList; + const QVariantList teamsList = isList ? accountiterator.value().toList() + : QVariantList({accountiterator.value()}); + 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. |