From cf1bbdd13e0db8856df672c367d3ec1610f6c556 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Mon, 25 May 2020 19:53:21 +0200 Subject: Switch to using the ModDataContent feature from the game plugin. --- src/modlistsortproxy.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 018b9760..99dba913 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -177,22 +177,7 @@ bool ModListSortProxy::lessThan(const QModelIndex &left, } } break; case ModList::COL_CONTENT: { - std::vector lContent = leftMod->getContents(); - std::vector rContent = rightMod->getContents(); - if (lContent.size() != rContent.size()) { - lt = lContent.size() < rContent.size(); - } - - int lValue = 0; - int rValue = 0; - for (ModInfo::EContent content : lContent) { - lValue += 2 << (unsigned int)content; - } - for (ModInfo::EContent content : rContent) { - rValue += 2 << (unsigned int)content; - } - - lt = lValue < rValue; + lt = leftMod->getContents() < rightMod->getContents(); } break; case ModList::COL_NAME: { int comp = QString::compare(leftMod->name(), rightMod->name(), Qt::CaseInsensitive); @@ -449,7 +434,7 @@ bool ModListSortProxy::categoryMatchesMod( bool ModListSortProxy::contentMatchesMod(ModInfo::Ptr info, bool enabled, int content) const { - return info->hasContent(static_cast(content)); + return info->hasContent(content); } bool ModListSortProxy::filterMatchesMod(ModInfo::Ptr info, bool enabled) const -- cgit v1.3.1