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

View file

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

View file

@ -91,10 +91,10 @@ private:
void calculateExtent();
void onColorChanged();
static inline std::vector<std::string> systemdataTypes {
static inline std::vector<std::string> supportedSystemdataTypes {
"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",
"genre", "players", "favorite", "completed", "kidgame",
"broken", "playcount", "controller", "altemulator"};