diff options
| author | LostDragonist <lost.dragonist@gmail.com> | 2019-01-31 11:31:22 -0600 |
|---|---|---|
| committer | LostDragonist <lost.dragonist@gmail.com> | 2019-01-31 11:31:22 -0600 |
| commit | 2201a5b0dd739f273f2a906eda3d4d31335c7c71 (patch) | |
| tree | ec06c0b04dbe91d835df899fb25f6238049f8628 /src/modinfo.cpp | |
| parent | 02433c486be3dff6e9e0801672081151143b164e (diff) | |
Make gameShortName comparisons case insensitive
Diffstat (limited to 'src/modinfo.cpp')
| -rw-r--r-- | src/modinfo.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 7ae41b02..905341b0 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -144,14 +144,22 @@ std::vector<ModInfo::Ptr> ModInfo::getByModID(QString game, int modID) { QMutexLocker locker(&s_Mutex); - auto iter = s_ModsByModID.find(std::pair<QString, int>(game, modID)); - if (iter == s_ModsByModID.end()) { + std::vector<unsigned int> match; + for (auto iter : s_ModsByModID) { + if (iter.first.second == modID) { + if (iter.first.first.compare(game, Qt::CaseInsensitive) == 0) { + match = iter.second; + break; + } + } + } + if (match.empty()) { return std::vector<ModInfo::Ptr>(); } std::vector<ModInfo::Ptr> result; - for (auto idxIter = iter->second.begin(); idxIter != iter->second.end(); ++idxIter) { - result.push_back(getByIndex(*idxIter)); + for (auto iter : match) { + result.push_back(getByIndex(iter)); } return result; |
