void RemotePeer::handle(const HeartBeatReply &heartBeatReply)
{
_heartBeatCount = 0;
-#if QT_VERSION >= 0x040700
emit lagUpdated(heartBeatReply.timestamp.msecsTo(QDateTime::currentDateTime().toUTC()) / 2);
-#else
- emit lagUpdated(heartBeatReply.timestamp.time().msecsTo(QDateTime::currentDateTime().toUTC().time()) / 2);
-#endif
}
else if (s.endsWith("\n"))
s.chop(1);
NetworkDataEvent *event = new NetworkDataEvent(EventManager::NetworkIncoming, this, s);
-#if QT_VERSION >= 0x040700
event->setTimestamp(QDateTime::currentDateTimeUtc());
-#else
- event->setTimestamp(QDateTime::currentDateTime().toUTC());
-#endif
emit newEvent(event);
}
}
disconnectFromIrc();
return;
}
-
+
emit socketOpen(identity, localAddress(), localPort(), peerAddress(), peerPort());
-
+
Server server = usedServer();
#ifdef HAVE_SSL
if (server.useSsl && !socket.isEncrypted())
return;
#endif
-#if QT_VERSION >= 0x040600
socket.setSocketOption(QAbstractSocket::KeepAliveOption, true);
-#endif
emit socketInitialized(identity, localAddress(), localPort(), peerAddress(), peerPort());
QString verboseMessage = tr("sending CTCP-%1 request to %2").arg(ctcpTag).arg(nick);
if (ctcpTag == "PING") {
-#if QT_VERSION >= 0x040700
message = QString::number(QDateTime::currentMSecsSinceEpoch());
-#else
- message = QString::number(QDateTime::currentDateTime().toTime_t());
-#endif
}
// FIXME make this a proper event
if (e->ctcpType() == CtcpEvent::Query)
defaultHandler(e->ctcpCmd(), e);
else {
-#if QT_VERSION >= 0x040700
displayMsg(e, Message::Server, tr("Received CTCP-PING answer from %1 with %2 milliseconds round trip time")
.arg(nickFromMask(e->prefix())).arg(QDateTime::fromMSecsSinceEpoch(e->param().toULongLong()).msecsTo(e->timestamp())));
-#else
- displayMsg(e, Message::Server, tr("Received CTCP-PING answer from %1 with %2 seconds round trip time")
- .arg(nickFromMask(e->prefix())).arg(QDateTime::fromTime_t(e->param().toInt()).secsTo(e->timestamp())));
-#endif
}
}
#ifndef CHATVIEWSEARCHCONTROLLER_H
#define CHATVIEWSEARCHCONTROLLER_H
-#include <QObject>
+#include <QGraphicsItem>
#include <QHash>
#include <QPointer>
#include <QString>
// Highlight Items
-#include <QGraphicsItem>
-
class SearchHighlightItem : public QObject, public QGraphicsItem
{
Q_OBJECT
-#if QT_VERSION >= 0x040600
Q_INTERFACES(QGraphicsItem)
-#endif
public :
SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0);
virtual QString iconNameForAction(QAction *action) // TODO Qt 4.7: fixme when we have converted our iconloader
{
QIcon icon(action->icon());
-#if QT_VERSION >= 0x040701
- // QIcon::name() is in the 4.7 git branch, but it is not in 4.7 TP.
- // If you get a build error here, you need to update your pre-release
- // of Qt 4.7.
return icon.isNull() ? QString() : icon.name();
-#else
- return QString();
-#endif
}
};