From 08939441e50e52c685c531a16704fb8f6e1138bd Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Tue, 23 Jun 2026 16:10:53 -0500 Subject: Fix FOMOD casing and VFS test coverage --- libs/installer_fomod/src/installerfomod.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'libs/installer_fomod/src/installerfomod.cpp') diff --git a/libs/installer_fomod/src/installerfomod.cpp b/libs/installer_fomod/src/installerfomod.cpp index e526610..9d9690a 100644 --- a/libs/installer_fomod/src/installerfomod.cpp +++ b/libs/installer_fomod/src/installerfomod.cpp @@ -1,5 +1,7 @@ #include "installerfomod.h" +#include + #include #include #include @@ -115,10 +117,14 @@ InstallerFomod::findFomodDirectory(std::shared_ptr tree) const bool InstallerFomod::isArchiveSupported(std::shared_ptr tree) const { tree = findFomodDirectory(tree); - if (tree != nullptr) { - return tree->exists("ModuleConfig.xml", FileTreeEntry::FILE); + if (tree == nullptr) { + return false; } - return false; + + return std::any_of(tree->begin(), tree->end(), [](const auto& entry) { + return entry->isFile() && + entry->name().compare("ModuleConfig.xml", Qt::CaseInsensitive) == 0; + }); } void InstallerFomod::appendImageFiles( @@ -145,7 +151,8 @@ InstallerFomod::buildFomodTree(std::shared_ptr tree) const for (auto entry : *fomodTree) { if (entry->isFile() && - (entry->compare("info.xml") == 0 || entry->compare("ModuleConfig.xml") == 0)) { + (entry->name().compare("info.xml", Qt::CaseInsensitive) == 0 || + entry->name().compare("ModuleConfig.xml", Qt::CaseInsensitive) == 0)) { entries.push_back(entry); } } -- cgit v1.3.1