summaryrefslogtreecommitdiffstats
path: root/filesorter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'filesorter.cpp')
-rw-r--r--filesorter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/filesorter.cpp b/filesorter.cpp
index 7c6d1d1..fcecfad 100644
--- a/filesorter.cpp
+++ b/filesorter.cpp
@@ -54,3 +54,12 @@ bool VideoSorter::lessThan(const QModelIndex &source_left, const QModelIndex &so
return QSortFilterProxyModel::lessThan(source_left, source_right);
}
+
+bool VideoSorter::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {
+ QModelIndex nameIdx = sourceModel()->index(source_row, 0, source_parent);
+ int attr = nameIdx.data(FileWidget::AttrsRole).toInt();
+ if(attr == FileWidget::Directory || attr == FileWidget::ParentDir){
+ return true;
+ }
+ return QSortFilterProxyModel::filterAcceptsRow(source_row, source_parent);
+}