| 41 | } |
| 42 | |
| 43 | QJsonValue ThemeParser::value(const QString &group, ThemeProperty property) const |
| 44 | { |
| 45 | static auto themeMetaEnum = QMetaEnum::fromType<Theme>(); |
| 46 | auto themeObj = fileObj.value(themeMetaEnum.valueToKey(defaultTheme)).toObject(); |
| 47 | if (themeObj.isEmpty() || !themeObj.contains(group)) |
| 48 | return {}; |
| 49 | |
| 50 | static auto propertyMetaEnum = QMetaEnum::fromType<ThemeProperty>(); |
| 51 | QString value = propertyMetaEnum.valueToKey(property); |
| 52 | auto propertyObj = themeObj.value(group).toObject(); |
| 53 | if (propertyObj.isEmpty() || !propertyObj.contains(value)) |
| 54 | return {}; |
| 55 | |
| 56 | return propertyObj.value(value); |
| 57 | } |
no test coverage detected