From 4ff76cab24698482ce759cb40a903b9bc26c8fae Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Fri, 6 Feb 2015 22:30:44 +0100 Subject: [PATCH] Remove support for obsolete Qt versions Now that we rely on Qt 4.8+, we can get rid of a few workaround that were in place for older versions. --- src/common/remotepeer.cpp | 4 ---- src/core/corenetwork.cpp | 10 ++-------- src/core/coreuserinputhandler.cpp | 4 ---- src/core/eventstringifier.cpp | 5 ----- src/qtui/chatviewsearchcontroller.h | 6 +----- src/qtui/statusnotifieritem.cpp | 7 ------- 6 files changed, 3 insertions(+), 33 deletions(-) diff --git a/src/common/remotepeer.cpp b/src/common/remotepeer.cpp index a3fb2879..e8fa578d 100644 --- a/src/common/remotepeer.cpp +++ b/src/common/remotepeer.cpp @@ -252,11 +252,7 @@ void RemotePeer::handle(const HeartBeat &heartBeat) 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 } diff --git a/src/core/corenetwork.cpp b/src/core/corenetwork.cpp index 1ba393fe..a3a0812a 100644 --- a/src/core/corenetwork.cpp +++ b/src/core/corenetwork.cpp @@ -416,11 +416,7 @@ void CoreNetwork::socketHasData() 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); } } @@ -450,17 +446,15 @@ void CoreNetwork::socketInitialized() 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()); diff --git a/src/core/coreuserinputhandler.cpp b/src/core/coreuserinputhandler.cpp index 6a53cad2..832c2e0c 100644 --- a/src/core/coreuserinputhandler.cpp +++ b/src/core/coreuserinputhandler.cpp @@ -169,11 +169,7 @@ void CoreUserInputHandler::handleCtcp(const BufferInfo &bufferInfo, const QStrin 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 diff --git a/src/core/eventstringifier.cpp b/src/core/eventstringifier.cpp index afb70c23..943727cd 100644 --- a/src/core/eventstringifier.cpp +++ b/src/core/eventstringifier.cpp @@ -733,12 +733,7 @@ void EventStringifier::handleCtcpPing(CtcpEvent *e) 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 } } diff --git a/src/qtui/chatviewsearchcontroller.h b/src/qtui/chatviewsearchcontroller.h index 294693de..66e09085 100644 --- a/src/qtui/chatviewsearchcontroller.h +++ b/src/qtui/chatviewsearchcontroller.h @@ -21,7 +21,7 @@ #ifndef CHATVIEWSEARCHCONTROLLER_H #define CHATVIEWSEARCHCONTROLLER_H -#include +#include #include #include #include @@ -87,14 +87,10 @@ private: // Highlight Items -#include - class SearchHighlightItem : public QObject, public QGraphicsItem { Q_OBJECT -#if QT_VERSION >= 0x040600 Q_INTERFACES(QGraphicsItem) -#endif public : SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0); diff --git a/src/qtui/statusnotifieritem.cpp b/src/qtui/statusnotifieritem.cpp index a1d2916a..a75c3255 100644 --- a/src/qtui/statusnotifieritem.cpp +++ b/src/qtui/statusnotifieritem.cpp @@ -52,14 +52,7 @@ protected: 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 } }; -- 2.20.1