summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikaƫl Capelle <capelle.mikael@gmail.com>2021-02-24 18:35:18 +0100
committerGitHub <noreply@github.com>2021-02-24 18:35:18 +0100
commitd6edc5d6b7d187b27a5e15a17b2a19ee44088834 (patch)
tree4419299e57a05073a05aea5731ef9bc115a55ebf /src
parent4040dc12b745091c9704d4e065256dad3381d05e (diff)
parent27c4861907d57c3e2b79bc476972325a6d6efa49 (diff)
Merge pull request #1433 from Holt59/fix-bycategory-sorting
Fix sorting by priority when grouping by priority.
Diffstat (limited to 'src')
-rw-r--r--src/modlistsortproxy.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index fc7f3270..4084af24 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -108,6 +108,12 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
if (sortColumn() != ModList::COL_PRIORITY) {
return QSortFilterProxyModel::lessThan(left, right);
}
+ else if (qobject_cast<QtGroupingProxy*>(sourceModel())) {
+ // if the underlying proxy is a QtGroupingProxy we need to rely on
+ // Qt::DisplayRole because the other roles are not correctly handled
+ // by that kind of proxy
+ return left.data(Qt::DisplayRole).toInt() < right.data(Qt::DisplayRole).toInt();
+ }
}
bool lOk, rOk;