summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLost Dragonist <lost.dragonist@gmail.com>2018-06-08 22:38:43 -0500
committerLost Dragonist <lost.dragonist@gmail.com>2018-06-08 22:48:53 -0500
commitcacf7e05428fa7ff8d3c6d1d5413460f21395d1c (patch)
treefc1e9f15eb7d636512748702945121389d9fc2a6
parentf09ec53fcfc83f2647bf4d04cfa280f172ae0ed7 (diff)
Allow sorting by "source game" column
-rw-r--r--src/modlistsortproxy.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index 435967c9..88084ae1 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -208,6 +208,16 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
if (leftTime != rightTime)
return leftTime < rightTime;
} break;
+ case ModList::COL_GAME: {
+ if (leftMod->getGameName() != rightMod->getGameName()) {
+ lt = leftMod->getGameName() < rightMod->getGameName();
+ }
+ else {
+ int comp = QString::compare(leftMod->name(), rightMod->name(), Qt::CaseInsensitive);
+ if (comp != 0)
+ lt = comp < 0;
+ }
+ } break;
case ModList::COL_PRIORITY: {
// nop, already compared by priority
} break;