From 0cf4104dc60134f207a60906e83311af986e0ada Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 17 Feb 2017 12:47:09 -0800 Subject: Handle negative dates (before the epoch) better The Qt model sorting for the dive date was using a unsigned number, which doesn't work for dates before 1970. Also, the dive date parsing got the year 1900 wrong. Not that we really care, because other parts of date handling will screw up with any date before the year 1904. So if you claim to be diving before 1904, you get basically random behavior. Signed-off-by: Linus Torvalds --- qt-models/divetripmodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-models') diff --git a/qt-models/divetripmodel.cpp b/qt-models/divetripmodel.cpp index d384b1913..20bdc3666 100644 --- a/qt-models/divetripmodel.cpp +++ b/qt-models/divetripmodel.cpp @@ -94,10 +94,10 @@ QVariant DiveItem::data(int column, int role) const Q_ASSERT(dive != NULL); switch (column) { case NR: - retVal = (qulonglong)dive->when; + retVal = (qlonglong)dive->when; break; case DATE: - retVal = (qulonglong)dive->when; + retVal = (qlonglong)dive->when; break; case RATING: retVal = dive->rating; -- cgit v1.2.3-70-g09d2