summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2020-05-28 19:48:21 +0200
committerMikaël Capelle <capelle.mikael@gmail.com>2020-05-28 19:48:21 +0200
commitd2b7a1a321d5cf496860f717eccdfb9487621169 (patch)
treead20b2202c9632189fc80a6664de2ea39d72ceca /src/modlistsortproxy.cpp
parent4791569790e9695512248a9acdfbcd1c96f13967 (diff)
Expose ModDataContentHolder from OrganizerCore instead of vector of Content.
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index 321722f5..b56dff78 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -184,16 +184,12 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
auto& rContents = rightMod->getContents();
unsigned int lValue = 0;
unsigned int rValue = 0;
- for (auto& content : m_Organizer->modDataContents()) {
- if (!content.isOnlyForFilter()) {
- if (std::find(std::begin(lContents), std::end(lContents), content.id()) != std::end(lContents)) {
- lValue += 2U << static_cast<unsigned int>(content.id());
- }
- if (std::find(std::begin(rContents), std::end(rContents), content.id()) != std::end(rContents)) {
- rValue += 2U << static_cast<unsigned int>(content.id());
- }
- }
- }
+ m_Organizer->modDataContents().forEachContentIn(lContents, [&lValue](auto const& content) {
+ lValue += 2U << static_cast<unsigned int>(content.id());
+ });
+ m_Organizer->modDataContents().forEachContentIn(rContents, [&rValue](auto const& content) {
+ rValue += 2U << static_cast<unsigned int>(content.id());
+ });
lt = lValue < rValue;
} break;
case ModList::COL_NAME: {