X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Fremotepeer.cpp;h=3ac55d1578cf651bac6db0ce0c74f1e269eb600f;hp=e33f56a9ebd3a69c7a4276b5446bf5b482f15331;hb=066490586148c2170446cfff300afd6e05e6a0e5;hpb=4c80eeb2d07b5ca75fd399b51c939961fdff1670 diff --git a/src/common/remotepeer.cpp b/src/common/remotepeer.cpp index e33f56a9..3ac55d15 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" @@ -30,7 +32,7 @@ using namespace Protocol; RemotePeer::RemotePeer(QTcpSocket *socket, QObject *parent) - : SignalProxy::AbstractPeer(parent), + : Peer(parent), _socket(socket), _signalProxy(0), _heartBeatTimer(new QTimer(this)), @@ -166,10 +168,10 @@ void RemotePeer::handle(const HeartBeat &heartBeat) 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; } - -