Fixed an issue where a legacy theme workaround for incorrect element types did not work as expected.

Also cleaned up a log warning message related to this.
This commit is contained in:
Leon Styhre 2022-09-15 17:29:34 +02:00
parent 8699bdcbb9
commit 3a41aa61c5

View file

@ -531,9 +531,9 @@ const ThemeData::ThemeElement* ThemeData::getElement(const std::string& view,
// If expectedType is an empty string, then skip type checking. // If expectedType is an empty string, then skip type checking.
if (elemIt->second.type != expectedType && !expectedType.empty()) { if (elemIt->second.type != expectedType && !expectedType.empty()) {
LOG(LogWarning) << " requested mismatched theme type for [" << view << "." << element LOG(LogWarning) << "ThemeData::getElement(): Requested element \"" << view << "." << element
<< "] - expected \"" << expectedType << "\", got \"" << elemIt->second.type << "\" has the wrong type, expected \"" << expectedType << "\", got \""
<< "\""; << elemIt->second.type << "\"";
return nullptr; return nullptr;
} }
@ -1176,7 +1176,7 @@ void ThemeData::parseElement(const pugi::xml_node& root,
if (legacyWorkaround == LegacyWorkaround::DATETIME) if (legacyWorkaround == LegacyWorkaround::DATETIME)
element.type = "datetime"; element.type = "datetime";
if (legacyWorkaround == LegacyWorkaround::TEXT) else if (legacyWorkaround == LegacyWorkaround::TEXT)
element.type = "text"; element.type = "text";
else if (legacyWorkaround == LegacyWorkaround::RATING) else if (legacyWorkaround == LegacyWorkaround::RATING)
element.type = "rating"; element.type = "rating";