From da7ae868ed93eccae3f762329c09fe53eb257807 Mon Sep 17 00:00:00 2001 From: Rainer Clasen Date: Sun, 24 Jul 2011 12:43:16 +0200 Subject: [PATCH] MacroDevice: use backwards compatible toTime_t toMSecsSinceEpoch requires QT 4.7. And as the caluclation doesnt require msec precision, toTime_t should be sufficient. Well, this is mostly, because I'm currently too lazy to update my QT... I guess, this doesn't have to be merged. --- src/SyncRideFile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SyncRideFile.cpp b/src/SyncRideFile.cpp index 2c8adc48e..fb81d30a2 100644 --- a/src/SyncRideFile.cpp +++ b/src/SyncRideFile.cpp @@ -178,11 +178,12 @@ struct SyncFileReaderState QDateTime t = QDateTime(QDate(2000+year,month,day), QTime(hour,min,sec)); - if (secs == 0.0 || rideFile->startTime().toMSecsSinceEpoch()<0) { + if (secs == 0.0 || rideFile->startTime().toTime_t() == (unsigned int)-1 ) { + rideFile->setStartTime(t); } else { - int gap = (t.toMSecsSinceEpoch() - rideFile->startTime().toMSecsSinceEpoch())/1000 - secs; + int gap = (t.toTime_t() - rideFile->startTime().toTime_t()) - secs; secs += gap; }