Looks like I recently introduced the use of some QDateTime stuff that appeared
in Qt 4.7. Let's use the old way of calculating the lag then if built against older
Qt...
Oh, also this fixes that we would show double the lag.
void RemoteConnection::handle(const HeartBeatReply &heartBeatReply)
{
_heartBeatCount = 0;
- emit lagUpdated(heartBeatReply.timestamp().msecsTo(QDateTime::currentDateTimeUtc()));
+#if QT_VERSION < 0x040700
+ emit lagUpdated(heartBeatReply.timestamp().time().msecsTo(QTime::currentTime()) / 2);
+#else
+ emit lagUpdated(heartBeatReply.timestamp().msecsTo(QDateTime::currentDateTime()) / 2);
+#endif
}
emit lagUpdated(_lag);
}
- dispatch(HeartBeat(QDateTime::currentDateTimeUtc()));
+ dispatch(HeartBeat(QDateTime::currentDateTime()));
++_heartBeatCount;
}