- Q_ASSERT(column < static_cast<int>(sizeof(sortingTypeTable) / sizeof(DolphinView::Sorting)));
- return sortingTypeTable[column];
-}
-
-bool DolphinSortFilterProxyModel::subSortLessThan(const QModelIndex& left,
- const QModelIndex& right) const
-{
- // switch (left.column()) {
- // case DolphinView::Revision:
- // return left > right;
- // ...
- return KDirSortFilterProxyModel::subSortLessThan(left, right);
-}
-
-bool DolphinSortFilterProxyModel::isDirectoryOrHidden(const KFileItem& left,
- const KFileItem& right,
- bool& result) const
-{
- bool isDirectoryOrHidden = true;
-
- const bool isLessThan = (sortOrder() == Qt::AscendingOrder);
- if (left.isDir() && !right.isDir()) {
- result = isLessThan;
- } else if (!left.isDir() && right.isDir()) {
- result = !isLessThan;
- } else if (left.isHidden() && !right.isHidden()) {
- result = isLessThan;
- } else if (!left.isHidden() && right.isHidden()) {
- result = !isLessThan;
- } else {
- isDirectoryOrHidden = false;
- }
-
- return isDirectoryOrHidden;