mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 08:38:45 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user