From 9c3ddb53c9042ead731fcbfcf9daf9fec60dbbf7 Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Wed, 27 May 2020 21:29:17 +0200 Subject: Fix sorting for the Content column. --- src/modlistsortproxy.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/modlistsortproxy.cpp') diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp index 99dba913..87db4fed 100644 --- a/src/modlistsortproxy.cpp +++ b/src/modlistsortproxy.cpp @@ -177,7 +177,15 @@ bool ModListSortProxy::lessThan(const QModelIndex &left, } } break; case ModList::COL_CONTENT: { - lt = leftMod->getContents() < rightMod->getContents(); + unsigned int lValue = 0; + unsigned int rValue = 0; + for (int content : leftMod->getContents()) { + lValue += 2U << static_cast(content); + } + for (int content : rightMod->getContents()) { + rValue += 2U << static_cast(content); + } + lt = lValue < rValue; } break; case ModList::COL_NAME: { int comp = QString::compare(leftMod->name(), rightMod->name(), Qt::CaseInsensitive); -- cgit v1.3.1