Bump CMake version
[quassel.git] / src / common / remoteconnection.cpp
index 4b73768..c67d3c7 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-2012 by the Quassel Project                        *
+ *   Copyright (C) 2005-2013 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -27,6 +27,8 @@
 
 #include "remoteconnection.h"
 
+using namespace Protocol;
+
 RemoteConnection::RemoteConnection(QTcpSocket *socket, QObject *parent)
     : SignalProxy::AbstractPeer(parent),
     _socket(socket),
@@ -164,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
 }
 
 
@@ -183,7 +189,7 @@ void RemoteConnection::sendHeartBeat()
         emit lagUpdated(_lag);
     }
 
-    dispatch(HeartBeat(QDateTime::currentDateTimeUtc()));
+    dispatch(HeartBeat(QDateTime::currentDateTime()));
     ++_heartBeatCount;
 }