diff options
author | Arno <arno@disconnect.de> | 2018-01-02 23:33:17 +0100 |
---|---|---|
committer | Arno <arno@disconnect.de> | 2018-01-02 23:33:17 +0100 |
commit | 54079b4b80af46663590c46109fabeb5cc94a6db (patch) | |
tree | 7d372b6551207301e53d1acca8a11dd288d4773f /filesorter.cpp | |
parent | aab351093e3ba713f1179a797d0f5929bdb4c92c (diff) | |
download | ShemovCleaner-54079b4b80af46663590c46109fabeb5cc94a6db.tar.gz ShemovCleaner-54079b4b80af46663590c46109fabeb5cc94a6db.tar.bz2 ShemovCleaner-54079b4b80af46663590c46109fabeb5cc94a6db.zip |
Sort size numerically, not alphabetically
Diffstat (limited to 'filesorter.cpp')
-rw-r--r-- | filesorter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/filesorter.cpp b/filesorter.cpp index d78b46d..7c6d1d1 100644 --- a/filesorter.cpp +++ b/filesorter.cpp @@ -45,5 +45,12 @@ bool VideoSorter::lessThan(const QModelIndex &source_left, const QModelIndex &so return leftData < rightData; } + //special case for size + if(source_left.column() == FileWidget::SizeColumn){ + qint64 left = source_left.data(FileWidget::SizeRole).toInt(); + qint64 right = source_right.data(FileWidget::SizeRole).toInt(); + return left < right; + } + return QSortFilterProxyModel::lessThan(source_left, source_right); } |