diff options
| author | SulfurNitride <lukew19@proton.me> | 2026-06-23 16:10:53 -0500 |
|---|---|---|
| committer | SulfurNitride <lukew19@proton.me> | 2026-06-23 16:10:53 -0500 |
| commit | 08939441e50e52c685c531a16704fb8f6e1138bd (patch) | |
| tree | 962932046d46d4fd33953c073e3eb95aeb768096 /libs/installer_fomod/src/installerfomod.cpp | |
| parent | f415cfae26153b0853466316c0d8d1738e029976 (diff) | |
Fix FOMOD casing and VFS test coverage
Diffstat (limited to 'libs/installer_fomod/src/installerfomod.cpp')
| -rw-r--r-- | libs/installer_fomod/src/installerfomod.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
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 <algorithm> + #include <QImageReader> #include <QStringList> #include <QtPlugin> @@ -115,10 +117,14 @@ InstallerFomod::findFomodDirectory(std::shared_ptr<const IFileTree> tree) const bool InstallerFomod::isArchiveSupported(std::shared_ptr<const IFileTree> 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<const IFileTree> 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); } } |
