diff options
Diffstat (limited to 'common/typeindex.cpp')
-rw-r--r-- | common/typeindex.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/typeindex.cpp b/common/typeindex.cpp index 3ee2492..ddf5df5 100644 --- a/common/typeindex.cpp +++ b/common/typeindex.cpp | |||
@@ -36,6 +36,10 @@ static QByteArray getByteArray(const QVariant &value) | |||
36 | 36 | ||
37 | static QByteArray toSortableByteArray(const QDateTime &date) | 37 | static QByteArray toSortableByteArray(const QDateTime &date) |
38 | { | 38 | { |
39 | //Sort invalid last | ||
40 | if (!date.isValid()) { | ||
41 | return QByteArray::number(std::numeric_limits<unsigned int>::max()); | ||
42 | } | ||
39 | return QByteArray::number(std::numeric_limits<unsigned int>::max() - date.toTime_t()); | 43 | return QByteArray::number(std::numeric_limits<unsigned int>::max() - date.toTime_t()); |
40 | } | 44 | } |
41 | 45 | ||