X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fremotepeer.cpp;h=d3752f10d896d253ac50b66e008607ce26972f05;hp=f8deabfa666ff4fd6d6c21a376524815e567ee09;hb=9dfc807d8f60135976d4ea0ed31022304fad8f4c;hpb=fd25e92f19d6afd4eb02844bcbf20ba132868303 diff --git a/src/common/remotepeer.cpp b/src/common/remotepeer.cpp index f8deabfa..d3752f10 100644 --- a/src/common/remotepeer.cpp +++ b/src/common/remotepeer.cpp @@ -23,6 +23,8 @@ #ifdef HAVE_SSL # include +#else +# include #endif #include "remotepeer.h" @@ -159,17 +161,17 @@ void RemotePeer::close(const QString &reason) void RemotePeer::handle(const HeartBeat &heartBeat) { - dispatch(HeartBeatReply(heartBeat.timestamp())); + dispatch(HeartBeatReply(heartBeat.timestamp)); } void RemotePeer::handle(const HeartBeatReply &heartBeatReply) { _heartBeatCount = 0; -#if QT_VERSION < 0x040700 - emit lagUpdated(heartBeatReply.timestamp().time().msecsTo(QTime::currentTime()) / 2); +#if QT_VERSION >= 0x040900 + emit lagUpdated(heartBeatReply.timestamp().msecsTo(QDateTime::currentDateTime().toUTC()) / 2); #else - emit lagUpdated(heartBeatReply.timestamp().msecsTo(QDateTime::currentDateTime()) / 2); + emit lagUpdated(heartBeatReply.timestamp().time().msecsTo(QDateTime::currentDateTime().toUTC().time()) / 2); #endif } @@ -189,8 +191,6 @@ void RemotePeer::sendHeartBeat() emit lagUpdated(_lag); } - dispatch(HeartBeat(QDateTime::currentDateTime())); + dispatch(HeartBeat(QDateTime::currentDateTime().toUTC())); ++_heartBeatCount; } - -