Commit ed494ad9 authored by Waqar Ahmed's avatar Waqar Ahmed Committed by Christoph Cullmann
Browse files

Sort by url instead of comparing strings

More consistent with S&R and `ls`

BUG: 435334
parent c9970b6e
Pipeline #141173 passed with stage
in 3 minutes and 37 seconds
......@@ -46,9 +46,12 @@ bool KateFileTreeProxyModel::lessThan(const QModelIndex &left, const QModelIndex
}
case KateFileTreeModel::PathRole: {
const QString left_name = model->data(left, KateFileTreeModel::PathRole).toString();
const QString right_name = model->data(right, KateFileTreeModel::PathRole).toString();
return collate.compare(left_name, right_name) < 0;
const auto l = model->data(left, KateFileTreeModel::DocumentRole).value<KTextEditor::Document *>();
const auto r = model->data(right, KateFileTreeModel::DocumentRole).value<KTextEditor::Document *>();
if (l && r) {
return l->url() < r->url();
}
return false;
}
case KateFileTreeModel::OpeningOrderRole:
......
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