* @brief Picks the best matching platform override map for the given platform key. */
| 53 | * @brief Picks the best matching platform override map for the given platform key. |
| 54 | */ |
| 55 | static QVariantMap selectPlatformOverride(const QVariantMap& platforms, const QString& platformKey) |
| 56 | { |
| 57 | if (platforms.isEmpty()) |
| 58 | return {}; |
| 59 | |
| 60 | if (platforms.contains(platformKey)) |
| 61 | return platforms.value(platformKey).toMap(); |
| 62 | |
| 63 | const auto os = platformKey.left(platformKey.indexOf('/')); |
| 64 | const auto wildcard = os + QStringLiteral("/*"); |
| 65 | if (platforms.contains(wildcard)) |
| 66 | return platforms.value(wildcard).toMap(); |
| 67 | |
| 68 | if (platforms.contains(QStringLiteral("*"))) |
| 69 | return platforms.value(QStringLiteral("*")).toMap(); |
| 70 | |
| 71 | return {}; |
| 72 | } |
| 73 | |
| 74 | //-------------------------------------------------------------------------------------------------- |
| 75 | // Constructor & singleton access functions |
no test coverage detected