summaryrefslogtreecommitdiff
path: root/src/modlistsortproxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modlistsortproxy.cpp')
-rw-r--r--src/modlistsortproxy.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/modlistsortproxy.cpp b/src/modlistsortproxy.cpp
index b5f1ee5c..833e16c3 100644
--- a/src/modlistsortproxy.cpp
+++ b/src/modlistsortproxy.cpp
@@ -214,9 +214,25 @@ bool ModListSortProxy::lessThan(const QModelIndex &left,
lt = comp < 0;
}
} break;
+ case ModList::COL_NOTES: {
+ QString leftComments = leftMod->comments();
+ QString rightComments = rightMod->comments();
+ if (leftComments != rightComments) {
+ if (leftComments.isEmpty()) {
+ lt = sortOrder() == Qt::DescendingOrder;
+ } else if (rightComments.isEmpty()) {
+ lt = sortOrder() == Qt::AscendingOrder;
+ } else {
+ lt = leftComments < rightComments;
+ }
+ }
+ } break;
case ModList::COL_PRIORITY: {
// nop, already compared by priority
} break;
+ default: {
+ qWarning() << "Sorting is not defined for column " << left.column();
+ } break;
}
return lt;
}