From 6d182dcdae10574d2663405d592a36fa2cec906e Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 21 Oct 2024 19:42:37 +0200 Subject: [PATCH] Compare content files and archives case insensitively when matching existing profiles --- components/config/launchersettings.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/components/config/launchersettings.cpp b/components/config/launchersettings.cpp index 6706051782d..f4749d0f930 100644 --- a/components/config/launchersettings.cpp +++ b/components/config/launchersettings.cpp @@ -266,11 +266,14 @@ void Config::LauncherSettings::setContentList(const GameSettings& gameSettings) if (!std::ranges::equal( dirs, listDirs, [](const SettingValue& dir, const QString& listDir) { return dir.value == listDir; })) continue; - if (files == getContentListFiles(listName) && archives == getArchiveList(listName)) - { - setCurrentContentListName(listName); - return; - } + constexpr auto compareFiles + = [](const QString& a, const QString& b) { return a.compare(b, Qt::CaseInsensitive) == 0; }; + if (!std::ranges::equal(files, getContentListFiles(listName), compareFiles)) + continue; + if (!std::ranges::equal(archives, getArchiveList(listName), compareFiles)) + continue; + setCurrentContentListName(listName); + return; } // otherwise, add content list