From: Manuel Nickschas Date: Sun, 27 Jan 2013 21:35:33 +0000 (+0100) Subject: Allow compilation against Qt < 4.7 again X-Git-Tag: 0.9-beta1~37 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=d3ce95c;hp=a4568e36edde5b86feeaae740a396f1bcaca1967 Allow compilation against Qt < 4.7 again 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. --- diff --git a/src/common/remoteconnection.cpp b/src/common/remoteconnection.cpp index 1ce29d43..26a93350 100644 --- a/src/common/remoteconnection.cpp +++ b/src/common/remoteconnection.cpp @@ -166,7 +166,11 @@ void RemoteConnection::handle(const HeartBeat &heartBeat) 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 } @@ -185,7 +189,7 @@ void RemoteConnection::sendHeartBeat() emit lagUpdated(_lag); } - dispatch(HeartBeat(QDateTime::currentDateTimeUtc())); + dispatch(HeartBeat(QDateTime::currentDateTime())); ++_heartBeatCount; }