diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-27 21:29:17 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-05-27 21:29:17 +0200 |
| commit | 9c3ddb53c9042ead731fcbfcf9daf9fec60dbbf7 (patch) | |
| tree | 37ff8ff7933263ad1bdd75fe5c1a1f2acf5bc92d /src | |
| parent | 70f1e8bdf63e0471d0ccde41926383536f247dcb (diff) | |
Fix sorting for the Content column.
Diffstat (limited to 'src')
| -rw-r--r-- | src/modlistsortproxy.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
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<unsigned int>(content);
+ }
+ for (int content : rightMod->getContents()) {
+ rValue += 2U << static_cast<unsigned int>(content);
+ }
+ lt = lValue < rValue;
} break;
case ModList::COL_NAME: {
int comp = QString::compare(leftMod->name(), rightMod->name(), Qt::CaseInsensitive);
|
