diff options
author | Arno <arno@disconnect.de> | 2016-09-03 07:06:55 +0200 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2016-09-03 07:06:55 +0200 |
commit | c3cfc9dd9d94a3c3ce2d58c0ec9320c03489f496 (patch) | |
tree | afae7b4c9754ed5c986a8988c0b5f5f74f988b96 /filewidget.h | |
parent | ea8d506033f5694ad3053aa691640aff3a675fb9 (diff) | |
download | ShemovCleaner-c3cfc9dd9d94a3c3ce2d58c0ec9320c03489f496.tar.gz ShemovCleaner-c3cfc9dd9d94a3c3ce2d58c0ec9320c03489f496.tar.bz2 ShemovCleaner-c3cfc9dd9d94a3c3ce2d58c0ec9320c03489f496.zip |
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<QStandardItem*> instead of individual QStandardItem*s.
Use enums to access columns.
Diffstat (limited to 'filewidget.h')
-rw-r--r-- | filewidget.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/filewidget.h b/filewidget.h index b00d742..504a6c7 100644 --- a/filewidget.h +++ b/filewidget.h @@ -9,12 +9,14 @@ class QLineEdit; class QPushButton; class QStandardItemModel; class QTreeView; -class FileSorter; +class VideoSorter; class FileWidget : public QWidget { Q_OBJECT public: - enum FileAttrs { NotPresent = 0, Present = 1, NoVideo = 2 }; + enum FileAttrs { NotPresent = 0, Present = 1, NoVideo = 2, ParentDir = 3, Directory = 4 }; + enum { RowCount = 4 }; + enum Colums { IconRow = 0, NameRow = 1, MimeRow = 2, Md5Row = 3 }; explicit FileWidget(QWidget *parent = 0); ~FileWidget(); @@ -36,7 +38,7 @@ class FileWidget : public QWidget { QPushButton *mSearch; QStandardItemModel *mModel; QTreeView *mFileView; - FileSorter *mProxy; + VideoSorter *mProxy; QSqlDatabase mDb; QSqlQuery mQOrigin; QSqlQuery mQFiles; |