Changed some theme loading issues log output from warning to error for DateTimeComponent and TextComponent.

This commit is contained in:
Leon Styhre 2022-08-19 17:11:16 +02:00
parent 0b34bd8991
commit fa81853127
3 changed files with 10 additions and 9 deletions

View file

@ -179,7 +179,7 @@ void DateTimeComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
mThemeMetadata = metadata; mThemeMetadata = metadata;
} }
else { else {
LOG(LogWarning) << "DateTimeComponent: Invalid theme configuration, property " LOG(LogError) << "DateTimeComponent: Invalid theme configuration, property "
"<metadata> defined as \"" "<metadata> defined as \""
<< metadata << "\""; << metadata << "\"";
} }

View file

@ -453,14 +453,14 @@ void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
if (properties & METADATA && elem->has("systemdata")) { if (properties & METADATA && elem->has("systemdata")) {
mThemeSystemdata = ""; mThemeSystemdata = "";
const std::string systemdata {elem->get<std::string>("systemdata")}; const std::string systemdata {elem->get<std::string>("systemdata")};
for (auto& type : systemdataTypes) { for (auto& type : supportedSystemdataTypes) {
if (type == systemdata) { if (type == systemdata) {
mThemeSystemdata = type; mThemeSystemdata = type;
break; break;
} }
} }
if (mThemeSystemdata == "") { if (mThemeSystemdata == "") {
LOG(LogWarning) LOG(LogError)
<< "TextComponent: Invalid theme configuration, property <systemdata> defined as \"" << "TextComponent: Invalid theme configuration, property <systemdata> defined as \""
<< systemdata << "\""; << systemdata << "\"";
} }
@ -469,14 +469,15 @@ void TextComponent::applyTheme(const std::shared_ptr<ThemeData>& theme,
if (properties & METADATA && elem->has("metadata")) { if (properties & METADATA && elem->has("metadata")) {
mThemeMetadata = ""; mThemeMetadata = "";
const std::string metadata {elem->get<std::string>("metadata")}; const std::string metadata {elem->get<std::string>("metadata")};
for (auto& type : metadataTypes) {
for (auto& type : supportedMetadataTypes) {
if (type == metadata) { if (type == metadata) {
mThemeMetadata = type; mThemeMetadata = type;
break; break;
} }
} }
if (mThemeMetadata == "") { if (mThemeMetadata == "") {
LOG(LogWarning) LOG(LogError)
<< "TextComponent: Invalid theme configuration, property <metadata> defined as \"" << "TextComponent: Invalid theme configuration, property <metadata> defined as \""
<< metadata << "\""; << metadata << "\"";
} }

View file

@ -91,10 +91,10 @@ private:
void calculateExtent(); void calculateExtent();
void onColorChanged(); void onColorChanged();
static inline std::vector<std::string> systemdataTypes { static inline std::vector<std::string> supportedSystemdataTypes {
"name", "fullname", "gamecount", "gamecount_games", "gamecount_favorites"}; "name", "fullname", "gamecount", "gamecount_games", "gamecount_favorites"};
static inline std::vector<std::string> metadataTypes { static inline std::vector<std::string> supportedMetadataTypes {
"name", "description", "rating", "developer", "publisher", "name", "description", "rating", "developer", "publisher",
"genre", "players", "favorite", "completed", "kidgame", "genre", "players", "favorite", "completed", "kidgame",
"broken", "playcount", "controller", "altemulator"}; "broken", "playcount", "controller", "altemulator"};