Commit 74e44ad9 authored by Ignat Semenov's avatar Ignat Semenov
Browse files

give folders sorting precedence regardless of the sorting order used

When comparing folders wth other file items in ProxyModel::lessThan(), take into account the current sorting order to allow folders to get to the start of the list. Note that the folders are still sorted according to the current sorting order.

CCBUG:180646
REVIEW:103884
parent 44b8e12e
......@@ -155,10 +155,10 @@ bool ProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) con
bool leftIsDir = isDir(left, dirModel);
bool rightIsDir = isDir(right, dirModel);
if (leftIsDir && !rightIsDir) {
return true;
return (sortOrder() == Qt::AscendingOrder);
}
if (!leftIsDir && rightIsDir) {
return false;
return (sortOrder() == Qt::DescendingOrder);
}
}
......
Markdown is supported
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