summaryrefslogtreecommitdiffstats
path: root/filesorter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'filesorter.cpp')
-rw-r--r--filesorter.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/filesorter.cpp b/filesorter.cpp
index aee6177..d78b46d 100644
--- a/filesorter.cpp
+++ b/filesorter.cpp
@@ -1,3 +1,5 @@
+#include <QDateTime>
+
#include "filesorter.h"
#include "torrentwidget.h"
#include "filewidget.h"
@@ -10,6 +12,11 @@ bool FileSorter::lessThan(const QModelIndex &source_left, const QModelIndex &sou
QVariant rightData = sourceModel()->data(source_right, TorrentWidget::PresentRole);
return leftData.toInt() < rightData.toInt();
}
+ if(source_left.column() == TorrentWidget::CreatedColumn){
+ QDateTime leftData = source_left.data(TorrentWidget::CreatedRole).toDateTime();
+ QDateTime rightData = source_right.data(TorrentWidget::CreatedRole).toDateTime();
+ return leftData < rightData;
+ }
return QSortFilterProxyModel::lessThan(source_left, source_right);
}