Skip to content

Commit

Permalink
Merge branch 'cifileprofiles' into 'master'
Browse files Browse the repository at this point in the history
Compare content files and archives case insensitively when matching existing profiles

See merge request OpenMW/openmw!4419
  • Loading branch information
Capostrophic committed Oct 24, 2024
2 parents cd2f261 + 6d182dc commit e9627e9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions components/config/launchersettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e9627e9

Please sign in to comment.