* @brief Derives a feature tier from the Lemon Squeezy variant name; any * non-empty variant that is not Enterprise maps to Pro on purpose, so a legacy * variant such as "Hobbyist" still unlocks the full feature set. */
| 45 | * variant such as "Hobbyist" still unlocks the full feature set. |
| 46 | */ |
| 47 | static Licensing::FeatureTier tierFromVariant(const QString& variant) |
| 48 | { |
| 49 | const auto lower = variant.toLower(); |
| 50 | |
| 51 | if (lower.startsWith("enterprise")) |
| 52 | return Licensing::FeatureTier::Enterprise; |
| 53 | |
| 54 | if (lower.startsWith("pro") || lower.startsWith("team")) |
| 55 | return Licensing::FeatureTier::Pro; |
| 56 | |
| 57 | if (!lower.isEmpty()) |
| 58 | return Licensing::FeatureTier::Pro; |
| 59 | |
| 60 | return Licensing::FeatureTier::None; |
| 61 | } |
| 62 | |
| 63 | //-------------------------------------------------------------------------------------------------- |
| 64 | // Constructor & singleton access functions |
no test coverage detected