Commit 3bb896a6 authored by Claudio Cambra's avatar Claudio Cambra
Browse files

Fix sort of overdue tasks, prevent overdue section being split up



Signed-off-by: Claudio Cambra's avatarClaudio Cambra <claudio.cambra@gmail.com>
parent 1f7d1508
Pipeline #236786 passed with stage
in 3 minutes and 58 seconds
......@@ -530,11 +530,15 @@ int TodoSortFilterProxyModel::compareDueDates(const QModelIndex &left, const QMo
} else if (!leftIsEmpty) { // Both have due dates
const auto leftDateTime = leftTodo->dtDue();
const auto rightDateTime = rightTodo->dtDue();
const auto leftOverdue = leftTodo->isOverdue();
const auto rightOverdue = rightTodo->isOverdue();
if (leftDateTime == rightDateTime) {
if (leftDateTime == rightDateTime && leftOverdue == rightOverdue) {
return 0;
} else {
} else if (leftOverdue == rightOverdue) {
return leftDateTime < rightDateTime ? -1 : 1;
} else {
return leftOverdue ? -1 : 1;
}
} else { // Neither has a due date
return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment