diff options
| author | Al <gabriel.cortesi@outlook.com> | 2018-06-10 09:55:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-10 09:55:41 +0200 |
| commit | 19d80cc23d298326526755a3d980e6a079123385 (patch) | |
| tree | ba32ca945536b2c5f101471848d6b352bf3a6d31 /src/modlistsortproxy.cpp | |
| parent | f09ec53fcfc83f2647bf4d04cfa280f172ae0ed7 (diff) | |
| parent | 0c4b1e9a928236542703a50cbe2c4b2d216feb0e (diff) | |
Merge pull request #400 from LostDragonist/Develop
Sort by game and fix for instance names
Diffstat (limited to 'src/modlistsortproxy.cpp')
| -rw-r--r-- | src/modlistsortproxy.cpp | 10 |
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;
|
