Changed some more theme loading errors to state that legacy configuration is simply unsupported

This commit is contained in:
Leon Styhre 2024-01-21 13:27:39 +01:00
parent 45ab2228fd
commit d27b0f85e3

View file

@ -568,7 +568,7 @@ void ThemeData::loadFile(const std::map<std::string, std::string>& sysDataMap,
if (!root) if (!root)
throw error << ": Missing <theme> tag"; throw error << ": Missing <theme> tag";
// Check for legacy theme version. // Check if there's an unsupported theme version tag.
if (root.child("formatVersion") != nullptr) if (root.child("formatVersion") != nullptr)
throw error << ": Unsupported <formatVersion> tag found"; throw error << ": Unsupported <formatVersion> tag found";
@ -655,7 +655,7 @@ void ThemeData::loadFile(const std::map<std::string, std::string>& sysDataMap,
parseIncludes(root); parseIncludes(root);
parseViews(root); parseViews(root);
if (root.child("feature") != nullptr) if (root.child("feature") != nullptr)
throw error << ": Legacy <feature> tag found"; throw error << ": Unsupported <feature> tag found";
parseVariants(root); parseVariants(root);
parseAspectRatios(root); parseAspectRatios(root);
} }
@ -1510,7 +1510,7 @@ void ThemeData::parseIncludes(const pugi::xml_node& root)
error << "ThemeData::parseIncludes(): "; error << "ThemeData::parseIncludes(): ";
error.setFiles(mPaths); error.setFiles(mPaths);
// Check for legacy theme version. // Check if there's an unsupported theme version tag.
if (root.child("formatVersion") != nullptr) if (root.child("formatVersion") != nullptr)
throw error << ": Unsupported <formatVersion> tag found"; throw error << ": Unsupported <formatVersion> tag found";
@ -1572,7 +1572,7 @@ void ThemeData::parseIncludes(const pugi::xml_node& root)
parseIncludes(theme); parseIncludes(theme);
parseViews(theme); parseViews(theme);
if (theme.child("feature") != nullptr) if (theme.child("feature") != nullptr)
throw error << ": Legacy <feature> tag found"; throw error << ": Unsupported <feature> tag found";
parseVariants(theme); parseVariants(theme);
parseAspectRatios(theme); parseAspectRatios(theme);
@ -1871,8 +1871,8 @@ void ThemeData::parseElement(const pugi::xml_node& root,
element.type = root.name(); element.type = root.name();
if (root.attribute("extra") != nullptr) if (root.attribute("extra") != nullptr)
throw error << ": Legacy \"extra\" attribute found for element of type \"" << element.type throw error << ": Unsupported \"extra\" attribute found for element of type \""
<< "\""; << element.type << "\"";
for (pugi::xml_node node {root.first_child()}; node; node = node.next_sibling()) { for (pugi::xml_node node {root.first_child()}; node; node = node.next_sibling()) {
auto typeIt = typeMap.find(node.name()); auto typeIt = typeMap.find(node.name());