From c3cfc9dd9d94a3c3ce2d58c0ec9320c03489f496 Mon Sep 17 00:00:00 2001 From: Arno Date: Sat, 3 Sep 2016 07:06:55 +0200 Subject: Fix Video sorting Show directories in FileWidget and always put ".." first, then the directories by creating a new QSortFilterProxyModel. For this the file attribute is needed for every column, so use QList instead of individual QStandardItem*s. Use enums to access columns. --- filesorter.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'filesorter.h') diff --git a/filesorter.h b/filesorter.h index 92bc71e..11012ed 100644 --- a/filesorter.h +++ b/filesorter.h @@ -10,7 +10,16 @@ class FileSorter : public QSortFilterProxyModel { protected: virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; +}; + +class VideoSorter : public QSortFilterProxyModel { + Q_OBJECT + public: + explicit VideoSorter(QObject *parent = 0); + protected: + virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const; }; + #endif // FILESORTER_H -- cgit v1.2.3-70-g09d2