Remove support for obsolete Qt versions
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 6 Feb 2015 21:30:44 +0000 (22:30 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 6 Feb 2015 21:30:44 +0000 (22:30 +0100)
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
src/core/corenetwork.cpp
src/core/coreuserinputhandler.cpp
src/core/eventstringifier.cpp
src/qtui/chatviewsearchcontroller.h
src/qtui/statusnotifieritem.cpp

index a3fb287..e8fa578 100644 (file)
@@ -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
 }
 
 
index 1ba393f..a3a0812 100644 (file)
@@ -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());
 
index 6a53cad..832c2e0 100644 (file)
@@ -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
index afb70c2..943727c 100644 (file)
@@ -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
     }
 }
index 294693d..66e0908 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef CHATVIEWSEARCHCONTROLLER_H
 #define CHATVIEWSEARCHCONTROLLER_H
 
-#include <QObject>
+#include <QGraphicsItem>
 #include <QHash>
 #include <QPointer>
 #include <QString>
@@ -87,14 +87,10 @@ private:
 
 
 // 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);
index a1d2916..a75c325 100644 (file)
@@ -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
     }
 };