summaryrefslogtreecommitdiffstats
path: root/qt-models/divetripmodel.cpp
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2017-02-17 12:47:09 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-17 15:08:38 -0800
commit0cf4104dc60134f207a60906e83311af986e0ada (patch)
tree5e90ce52526bf31912338985247a761712e36f97 /qt-models/divetripmodel.cpp
parentc5b9cfcaf655bd5af3bf57277b3591505d84e1cb (diff)
downloadsubsurface-0cf4104dc60134f207a60906e83311af986e0ada.tar.gz
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 <torvalds@linux-foundation.org>
Diffstat (limited to 'qt-models/divetripmodel.cpp')
-rw-r--r--qt-models/divetripmodel.cpp4
1 files changed, 2 insertions, 2 deletions
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;