qt4-b-gone: Remove all code supporting Qt < 5.5 and KDE4
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 17 Jul 2018 22:42:45 +0000 (00:42 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 18 Nov 2018 10:06:43 +0000 (11:06 +0100)
Remove compatibility code for Qt versions we no longer support.

61 files changed:
src/client/clientauthhandler.cpp
src/client/clientauthhandler.h
src/client/clientidentity.cpp
src/client/networkmodel.cpp
src/common/basichandler.cpp
src/common/eventmanager.cpp
src/common/expressionmatch.cpp
src/common/expressionmatch.h
src/common/logger.cpp
src/common/logger.h
src/common/main.cpp
src/common/nickhighlightmatcher.h
src/common/quassel.cpp
src/common/quassel.h
src/common/signalproxy.cpp
src/common/signalproxy.h
src/common/syncableobject.cpp
src/core/coreidentity.cpp
src/core/coreuserinputhandler.cpp
src/core/sslserver.cpp
src/core/sslserver.h
src/core/storage.cpp
src/qtui/chatscene.cpp
src/qtui/chatview.cpp
src/qtui/chatviewsearchcontroller.h
src/qtui/coreconfigwizard.cpp
src/qtui/knotificationbackend.cpp
src/qtui/legacysystemtray.cpp
src/qtui/legacysystemtray.h
src/qtui/mainwin.cpp
src/qtui/mainwin.h
src/qtui/qtui.cpp
src/qtui/qtui.h
src/qtui/qtuiapplication.cpp
src/qtui/qtuiapplication.h
src/qtui/settingspages/appearancesettingspage.cpp
src/qtui/settingspages/corehighlightsettingspage.cpp
src/qtui/settingspages/highlightsettingspage.cpp
src/qtui/settingspages/identityeditwidget.cpp
src/qtui/sslinfodlg.cpp
src/qtui/statusnotifieritem.cpp
src/qtui/statusnotifieritem.h
src/qtui/statusnotifieritemdbus.cpp
src/qtui/systemtray.cpp
src/qtui/topicwidget.cpp
src/uisupport/action.cpp
src/uisupport/action.h
src/uisupport/actioncollection.cpp
src/uisupport/actioncollection.h
src/uisupport/bufferview.cpp
src/uisupport/bufferview.h
src/uisupport/colorbutton.cpp
src/uisupport/graphicalui.cpp
src/uisupport/graphicalui.h
src/uisupport/multilineedit.cpp
src/uisupport/multilineedit.h
src/uisupport/nickview.cpp
src/uisupport/styledlabel.cpp
src/uisupport/treeviewtouch.cpp
src/uisupport/uistyle.cpp
src/uisupport/uistyle.h

index 322f58a..a29505f 100644 (file)
@@ -20,8 +20,6 @@
 
 #include "clientauthhandler.h"
 
 
 #include "clientauthhandler.h"
 
-// TODO: support system application proxy (new in Qt 4.6)
-
 #include <QtEndian>
 
 #ifdef HAVE_SSL
 #include <QtEndian>
 
 #ifdef HAVE_SSL
 #include "logmessage.h"
 #include "peerfactory.h"
 
 #include "logmessage.h"
 #include "peerfactory.h"
 
-#if QT_VERSION < 0x050000
-#    include "../../3rdparty/sha512/sha512.h"
-#endif
-
 using namespace Protocol;
 
 ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent)
 using namespace Protocol;
 
 ClientAuthHandler::ClientAuthHandler(CoreAccount account, QObject *parent)
@@ -505,11 +499,7 @@ void ClientAuthHandler::onSslErrors()
         break;
 
     case ClientAuthHandler::DigestVersion::Sha2_512:
         break;
 
     case ClientAuthHandler::DigestVersion::Sha2_512:
-#if QT_VERSION >= 0x050000
         calculatedDigest = socket->peerCertificate().digest(QCryptographicHash::Sha512);
         calculatedDigest = socket->peerCertificate().digest(QCryptographicHash::Sha512);
-#else
-        calculatedDigest = sha2_512(socket->peerCertificate().toDer());
-#endif
         break;
 
     default:
         break;
 
     default:
@@ -527,11 +517,7 @@ void ClientAuthHandler::onSslErrors()
         }
 
         if (permanently) {
         }
 
         if (permanently) {
-#if QT_VERSION >= 0x050000
             s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512));
             s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512));
-#else
-            s.setAccountValue("SslCert", sha2_512(socket->peerCertificate().toDer()));
-#endif
             s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest);
         }
         else {
             s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest);
         }
         else {
@@ -540,28 +526,11 @@ void ClientAuthHandler::onSslErrors()
         }
     }
     else if (knownDigestVersion != ClientAuthHandler::DigestVersion::Latest) {
         }
     }
     else if (knownDigestVersion != ClientAuthHandler::DigestVersion::Latest) {
-#if QT_VERSION >= 0x050000
         s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512));
         s.setAccountValue("SslCert", socket->peerCertificate().digest(QCryptographicHash::Sha512));
-#else
-        s.setAccountValue("SslCert", sha2_512(socket->peerCertificate().toDer()));
-#endif
         s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest);
     }
 
     socket->ignoreSslErrors();
 }
 
         s.setAccountValue("SslCertDigestVersion", ClientAuthHandler::DigestVersion::Latest);
     }
 
     socket->ignoreSslErrors();
 }
 
-#if QT_VERSION < 0x050000
-QByteArray ClientAuthHandler::sha2_512(const QByteArray &input) {
-    unsigned char output[64];
-    sha512((unsigned char*) input.constData(), input.size(), output, false);
-    // QByteArray::fromRawData() cannot be used here because that constructor
-    // does not copy "output" and the data is clobbered when the variable goes
-    // out of scope.
-    QByteArray result;
-    result.append((char*) output, 64);
-    return result;
-}
-#endif
-
 #endif /* HAVE_SSL */
 #endif /* HAVE_SSL */
index 888f935..a43d9c8 100644 (file)
@@ -90,10 +90,6 @@ private:
     void checkAndEnableSsl(bool coreSupportsSsl);
     void startRegistration();
 
     void checkAndEnableSsl(bool coreSupportsSsl);
     void startRegistration();
 
-#if QT_VERSION < 0x050000
-    QByteArray sha2_512(const QByteArray &input);
-#endif
-
 private slots:
     void onSocketConnected();
     void onSocketStateChanged(QAbstractSocket::SocketState state);
 private slots:
     void onSocketConnected();
     void onSocketStateChanged(QAbstractSocket::SocketState state);
index 3507a10..08a24b7 100644 (file)
@@ -111,10 +111,8 @@ void CertIdentity::markClean()
 void ClientCertManager::setSslKey(const QByteArray &encoded)
 {
     QSslKey key(encoded, QSsl::Rsa);
 void ClientCertManager::setSslKey(const QByteArray &encoded)
 {
     QSslKey key(encoded, QSsl::Rsa);
-#if QT_VERSION >= 0x050500
     if (key.isNull() && Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys))
         key = QSslKey(encoded, QSsl::Ec);
     if (key.isNull() && Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys))
         key = QSslKey(encoded, QSsl::Ec);
-#endif
     if (key.isNull())
         key = QSslKey(encoded, QSsl::Dsa);
     _certIdentity->setSslKey(key);
     if (key.isNull())
         key = QSslKey(encoded, QSsl::Dsa);
     _certIdentity->setSslKey(key);
@@ -126,5 +124,4 @@ void ClientCertManager::setSslCert(const QByteArray &encoded)
     _certIdentity->setSslCert(QSslCertificate(encoded));
 }
 
     _certIdentity->setSslCert(QSslCertificate(encoded));
 }
 
-
 #endif // HAVE_SSL
 #endif // HAVE_SSL
index 0907dee..5daec85 100644 (file)
@@ -22,9 +22,6 @@
 
 #include <QAbstractItemView>
 #include <QMimeData>
 
 #include <QAbstractItemView>
 #include <QMimeData>
-#if QT_VERSION < 0x050000
-#include <QTextDocument>        // for Qt::escape()
-#endif
 
 #include "buffermodel.h"
 #include "buffersettings.h"
 
 #include "buffermodel.h"
 #include "buffersettings.h"
@@ -86,11 +83,7 @@ QString NetworkItem::escapeHTML(const QString &string, bool useNonbreakingSpaces
 {
     // QString.replace() doesn't guarantee the source string will remain constant.
     // Use a local variable to avoid compiler errors.
 {
     // QString.replace() doesn't guarantee the source string will remain constant.
     // Use a local variable to avoid compiler errors.
-#if QT_VERSION < 0x050000
-    QString formattedString = Qt::escape(string);
-#else
     QString formattedString = string.toHtmlEscaped();
     QString formattedString = string.toHtmlEscaped();
-#endif
     return (useNonbreakingSpaces ? formattedString.replace(" ", "&nbsp;") : formattedString);
 }
 
     return (useNonbreakingSpaces ? formattedString.replace(" ", "&nbsp;") : formattedString);
 }
 
index fe7531d..6ad7828 100644 (file)
@@ -51,11 +51,7 @@ const QHash<QString, int> &BasicHandler::handlerHash()
 {
     if (!_initDone) {
         for (int i = metaObject()->methodOffset(); i < metaObject()->methodCount(); i++) {
 {
     if (!_initDone) {
         for (int i = metaObject()->methodOffset(); i < metaObject()->methodCount(); i++) {
-#if QT_VERSION >= 0x050000
             QString methodSignature = metaObject()->method(i).methodSignature();
             QString methodSignature = metaObject()->method(i).methodSignature();
-#else
-            QString methodSignature = metaObject()->method(i).signature();
-#endif
             if (methodSignature.startsWith("defaultHandler")) {
                 _defaultHandler = i;
                 continue;
             if (methodSignature.startsWith("defaultHandler")) {
                 _defaultHandler = i;
                 continue;
index 79bed3f..f43f6ed 100644 (file)
@@ -148,12 +148,7 @@ int EventManager::findEventType(const QString &methodSignature_, const QString &
 void EventManager::registerObject(QObject *object, Priority priority, const QString &methodPrefix, const QString &filterPrefix)
 {
     for (int i = object->metaObject()->methodOffset(); i < object->metaObject()->methodCount(); i++) {
 void EventManager::registerObject(QObject *object, Priority priority, const QString &methodPrefix, const QString &filterPrefix)
 {
     for (int i = object->metaObject()->methodOffset(); i < object->metaObject()->methodCount(); i++) {
-#if QT_VERSION >= 0x050000
         QString methodSignature = object->metaObject()->method(i).methodSignature();
         QString methodSignature = object->metaObject()->method(i).methodSignature();
-#else
-        QString methodSignature = object->metaObject()->method(i).signature();
-#endif
-
         int eventType = findEventType(methodSignature, methodPrefix);
         if (eventType > 0) {
             Handler handler(object, i, priority);
         int eventType = findEventType(methodSignature, methodPrefix);
         if (eventType > 0) {
             Handler handler(object, i, priority);
index bbcd1da..ae5661e 100644 (file)
 #include <QString>
 #include <QStringList>
 
 #include <QString>
 #include <QStringList>
 
-#if QT_VERSION >= 0x050000
-#include <QRegularExpression>
-#else
-#include <QRegExp>
-#endif
-
 #include "logmessage.h"
 
 ExpressionMatch::ExpressionMatch(const QString &expression, MatchMode mode, bool caseSensitive)
 #include "logmessage.h"
 
 ExpressionMatch::ExpressionMatch(const QString &expression, MatchMode mode, bool caseSensitive)
@@ -66,15 +60,7 @@ bool ExpressionMatch::match(const QString &string, bool matchEmpty) const
     // If specified, first check inverted rules
     if (_matchInvertRegExActive && _matchInvertRegEx.isValid()) {
         // Check inverted match rule
     // If specified, first check inverted rules
     if (_matchInvertRegExActive && _matchInvertRegEx.isValid()) {
         // Check inverted match rule
-
-        // See _matchRegEx section below for explanations of QRegExp vs. QRegularExpression
-        if (
-#if QT_VERSION >= 0x050000
-                _matchInvertRegEx.match(string).hasMatch()
-#else
-                _matchInvertRegEx.indexIn(string) != -1
-#endif
-                ) {
+        if (_matchInvertRegEx.match(string).hasMatch()) {
             // Inverted rule matched, the rest of the rule cannot match
             return false;
         }
             // Inverted rule matched, the rest of the rule cannot match
             return false;
         }
@@ -82,17 +68,9 @@ bool ExpressionMatch::match(const QString &string, bool matchEmpty) const
 
     if (_matchRegExActive && _matchRegEx.isValid()) {
         // Check regular match rule
 
     if (_matchRegExActive && _matchRegEx.isValid()) {
         // Check regular match rule
-    #if QT_VERSION >= 0x050000
-        // QRegularExpression does partial matching by default (exact matching requires anchoring
-        // expressions to be added)
-        // See https://doc.qt.io/qt-5/qregularexpression.html#porting-from-qregexp-exactmatch
         return _matchRegEx.match(string).hasMatch();
         return _matchRegEx.match(string).hasMatch();
-    #else
-        // QRegExp partial matching is done via indexIn
-        // See https://doc.qt.io/qt-5/qregexp.html#indexIn
-        return (_matchRegEx.indexIn(string) != -1);
-    #endif
-    } else {
+    }
+    else {
         // If no valid regular rules exist, due to the isValid() check there must be valid inverted
         // rules that did not match.  Count this as properly matching (implicit wildcard).
         return true;
         // If no valid regular rules exist, due to the isValid() check there must be valid inverted
         // rules that did not match.  Count this as properly matching (implicit wildcard).
         return true;
@@ -422,24 +400,13 @@ void ExpressionMatch::cacheRegEx()
 }
 
 
 }
 
 
-#if QT_VERSION >= 0x050000
 QRegularExpression ExpressionMatch::regExFactory(const QString &regExString,
                                                  bool caseSensitive)
 QRegularExpression ExpressionMatch::regExFactory(const QString &regExString,
                                                  bool caseSensitive)
-#else
-QRegExp ExpressionMatch::regExFactory(const QString &regExString, bool caseSensitive)
-#endif
 {
     // Construct the regular expression object, setting case sensitivity as appropriate
 {
     // Construct the regular expression object, setting case sensitivity as appropriate
-#if QT_VERSION >= 0x050000
-    QRegularExpression newRegEx =
-            QRegularExpression(regExString, caseSensitive ?
-                                   QRegularExpression::PatternOption::NoPatternOption
-                                 : QRegularExpression::PatternOption::CaseInsensitiveOption );
-#else
-    QRegExp newRegEx = QRegExp(regExString, caseSensitive ?
-                                   Qt::CaseSensitivity::CaseSensitive
-                                 : Qt::CaseSensitivity::CaseInsensitive);
-#endif
+    QRegularExpression newRegEx = QRegularExpression(regExString, caseSensitive ?
+                                                         QRegularExpression::PatternOption::NoPatternOption
+                                                       : QRegularExpression::PatternOption::CaseInsensitiveOption);
 
     // Check if rule is valid
     if (!newRegEx.isValid()) {
 
     // Check if rule is valid
     if (!newRegEx.isValid()) {
@@ -449,8 +416,8 @@ QRegExp ExpressionMatch::regExFactory(const QString &regExString, bool caseSensi
         qDebug() << "Internal regular expression component" << regExString
                  << "is invalid and will be ignored";
     }
         qDebug() << "Internal regular expression component" << regExString
                  << "is invalid and will be ignored";
     }
-    // Qt 5.4 (QT_VERSION >= 0x050400) offers explicit control over when QRegularExpression objects
-    // get optimized.  By default, patterns are only optimized after some number of uses as defined
+    // Qt offers explicit control over when QRegularExpression objects get optimized.
+    // By default, patterns are only optimized after some number of uses as defined
     // within Qt internals.
     //
     // In the context of ExpressionMatch, some regular expressions might go unused, e.g. a highlight
     // within Qt internals.
     //
     // In the context of ExpressionMatch, some regular expressions might go unused, e.g. a highlight
@@ -465,10 +432,7 @@ QRegExp ExpressionMatch::regExFactory(const QString &regExString, bool caseSensi
     //
     // else {
     //     // Optimize regex now
     //
     // else {
     //     // Optimize regex now
-    // #if QT_VERSION >= 0x050400
     //     newRegEx.optimize();
     //     newRegEx.optimize();
-    // #endif
-    //
     // }
     //
     // NOTE: This should only be called if the expression is valid!  Apply within an "else" of the
     // }
     //
     // NOTE: This should only be called if the expression is valid!  Apply within an "else" of the
@@ -483,11 +447,7 @@ QRegExp ExpressionMatch::regExFactory(const QString &regExString, bool caseSensi
 QString ExpressionMatch::regExEscape(const QString &phrase)
 {
     // Escape the given phrase of any special regular expression characters
 QString ExpressionMatch::regExEscape(const QString &phrase)
 {
     // Escape the given phrase of any special regular expression characters
-#if QT_VERSION >= 0x050000
     return QRegularExpression::escape(phrase);
     return QRegularExpression::escape(phrase);
-#else
-    return QRegExp::escape(phrase);
-#endif
 }
 
 
 }
 
 
index 0f5acfc..2712778 100644 (file)
 
 #pragma once
 
 
 #pragma once
 
+#include <QRegularExpression>
 #include <QString>
 #include <QStringList>
 
 #include <QString>
 #include <QStringList>
 
-#if QT_VERSION >= 0x050000
-#include <QRegularExpression>
-#else
-#include <QRegExp>
-#endif
-
 /**
  * Expression matcher with multiple modes of operation and automatic caching for performance
  */
 /**
  * Expression matcher with multiple modes of operation and automatic caching for performance
  */
@@ -37,11 +32,7 @@ class ExpressionMatch
 
 public:
     /// Expression matching mode
 
 public:
     /// Expression matching mode
-#if QT_VERSION >= 0x050000
     enum class MatchMode {
     enum class MatchMode {
-#else
-    enum MatchMode {
-#endif
         MatchPhrase,        ///< Match phrase as specified, no special handling
         MatchMultiPhrase,   ///< Match phrase as specified, split on \n only
         MatchWildcard,      ///< Match wildcards, "!" at start inverts, "\" escapes
         MatchPhrase,        ///< Match phrase as specified, no special handling
         MatchMultiPhrase,   ///< Match phrase as specified, split on \n only
         MatchWildcard,      ///< Match wildcards, "!" at start inverts, "\" escapes
@@ -189,13 +180,9 @@ private:
      *
      * @param regExString    Regular expression string
      * @param caseSensitive  If true, match case-sensitively, otherwise ignore case when matching
      *
      * @param regExString    Regular expression string
      * @param caseSensitive  If true, match case-sensitively, otherwise ignore case when matching
-     * @return Configured QRegExp class on Qt 4, QRegularExpression on Qt 5
+     * @return Configured QRegularExpression
      */
      */
-#if QT_VERSION >= 0x050000
     static QRegularExpression regExFactory(const QString &regExString, bool caseSensitive);
     static QRegularExpression regExFactory(const QString &regExString, bool caseSensitive);
-#else
-    static QRegExp regExFactory(const QString &regExString, bool caseSensitive);
-#endif
 
     /**
      * Escapes any regular expression characters in a string so they have no special meaning
 
     /**
      * Escapes any regular expression characters in a string so they have no special meaning
@@ -244,18 +231,10 @@ private:
     bool _sourceExpressionEmpty = false;             ///< Cached expression match string is empty
 
     /// Underlying regular expression matching instance for normal (noninverted) rules
     bool _sourceExpressionEmpty = false;             ///< Cached expression match string is empty
 
     /// Underlying regular expression matching instance for normal (noninverted) rules
-#if QT_VERSION >= 0x050000
     QRegularExpression _matchRegEx = {};
     QRegularExpression _matchRegEx = {};
-#else
-    QRegExp _matchRegEx = {};
-#endif
     bool _matchRegExActive = false;                  ///< If true, use normal expression in matching
 
     /// Underlying regular expression matching instance for inverted rules
     bool _matchRegExActive = false;                  ///< If true, use normal expression in matching
 
     /// Underlying regular expression matching instance for inverted rules
-#if QT_VERSION >= 0x050000
     QRegularExpression _matchInvertRegEx = {};
     QRegularExpression _matchInvertRegEx = {};
-#else
-    QRegExp _matchInvertRegEx = {};
-#endif
     bool _matchInvertRegExActive = false;            ///< If true, use invert expression in matching
 };
     bool _matchInvertRegExActive = false;            ///< If true, use invert expression in matching
 };
index ed8d802..a72c68f 100644 (file)
@@ -53,11 +53,7 @@ Logger::Logger(QObject *parent)
 
     connect(this, SIGNAL(messageLogged(Logger::LogEntry)), this, SLOT(onMessageLogged(Logger::LogEntry)));
 
 
     connect(this, SIGNAL(messageLogged(Logger::LogEntry)), this, SLOT(onMessageLogged(Logger::LogEntry)));
 
-#if QT_VERSION < 0x050000
-    qInstallMsgHandler(Logger::messageHandler);
-#else
     qInstallMessageHandler(Logger::messageHandler);
     qInstallMessageHandler(Logger::messageHandler);
-#endif
 }
 
 
 }
 
 
@@ -130,11 +126,7 @@ bool Logger::setup(bool keepMessages)
 }
 
 
 }
 
 
-#if QT_VERSION < 0x050000
-void Logger::messageHandler(QtMsgType type, const char *message)
-#else
 void Logger::messageHandler(QtMsgType type, const QMessageLogContext &, const QString &message)
 void Logger::messageHandler(QtMsgType type, const QMessageLogContext &, const QString &message)
-#endif
 {
     Quassel::instance()->logger()->handleMessage(type, message);
 }
 {
     Quassel::instance()->logger()->handleMessage(type, message);
 }
@@ -146,11 +138,9 @@ void Logger::handleMessage(QtMsgType type, const QString &msg)
     case QtDebugMsg:
         handleMessage(LogLevel::Debug, msg);
         break;
     case QtDebugMsg:
         handleMessage(LogLevel::Debug, msg);
         break;
-#if QT_VERSION >= 0x050500
     case QtInfoMsg:
         handleMessage(LogLevel::Info, msg);
         break;
     case QtInfoMsg:
         handleMessage(LogLevel::Info, msg);
         break;
-#endif
     case QtWarningMsg:
         handleMessage(LogLevel::Warning, msg);
         break;
     case QtWarningMsg:
         handleMessage(LogLevel::Warning, msg);
         break;
index 8c1f2f0..7752a74 100644 (file)
@@ -72,11 +72,7 @@ public:
      */
     std::vector<Logger::LogEntry> messages() const;
 
      */
     std::vector<Logger::LogEntry> messages() const;
 
-#if QT_VERSION < 0x050000
-    static void messageHandler(QtMsgType type, const char *message);
-#else
     static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message);
     static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &message);
-#endif
 
     /**
      * Takes the given message with the given log level, formats it and emits the @a messageLogged() signal.
 
     /**
      * Takes the given message with the given log level, formats it and emits the @a messageLogged() signal.
index 234891c..598425f 100644 (file)
 #error "Something is wrong - you need to #define a build mode!"
 #endif
 
 #error "Something is wrong - you need to #define a build mode!"
 #endif
 
-// We don't want quasselcore to depend on KDE
-#if defined HAVE_KDE4 && defined BUILD_CORE
-#  undef HAVE_KDE4
-#endif
 // We don't want quasselcore to depend on KDE
 #if defined HAVE_KF5 && defined BUILD_CORE
 #  undef HAVE_KF5
 #endif
 
 // We don't want quasselcore to depend on KDE
 #if defined HAVE_KF5 && defined BUILD_CORE
 #  undef HAVE_KF5
 #endif
 
-#ifdef HAVE_KDE4
-#  include <KAboutData>
-#  include "kcmdlinewrapper.h"
-#elif defined HAVE_KF5
+#if defined HAVE_KF5
 #  include <KCoreAddons/KAboutData>
 #  include <KCoreAddons/Kdelibs4ConfigMigrator>
 #  include <KCoreAddons/KAboutData>
 #  include <KCoreAddons/Kdelibs4ConfigMigrator>
-#  include "qt5cliparser.h"
-#elif defined HAVE_QT5
-#  include "qt5cliparser.h"
-#else
-#  include "cliparser.h"
 #endif
 
 #if !defined(BUILD_CORE) && defined(STATIC)
 #endif
 
 #if !defined(BUILD_CORE) && defined(STATIC)
@@ -70,6 +58,7 @@ Q_IMPORT_PLUGIN(qjpeg)
 Q_IMPORT_PLUGIN(qgif)
 #endif
 
 Q_IMPORT_PLUGIN(qgif)
 #endif
 
+#include "qt5cliparser.h"
 #include "quassel.h"
 #include "types.h"
 
 #include "quassel.h"
 #include "types.h"
 
@@ -82,30 +71,18 @@ int main(int argc, char **argv)
     // Instantiate early, so log messages are handled
     Quassel quassel;
 
     // Instantiate early, so log messages are handled
     Quassel quassel;
 
-#if QT_VERSION < 0x050000
-    // All our source files are in UTF-8, and Qt5 even requires that
-    QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
-    QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
-#endif
-
     Quassel::setupBuildInfo();
     QCoreApplication::setApplicationName(Quassel::buildInfo().applicationName);
     QCoreApplication::setApplicationVersion(Quassel::buildInfo().plainVersionString);
     QCoreApplication::setOrganizationName(Quassel::buildInfo().organizationName);
     QCoreApplication::setOrganizationDomain(Quassel::buildInfo().organizationDomain);
 
     Quassel::setupBuildInfo();
     QCoreApplication::setApplicationName(Quassel::buildInfo().applicationName);
     QCoreApplication::setApplicationVersion(Quassel::buildInfo().plainVersionString);
     QCoreApplication::setOrganizationName(Quassel::buildInfo().organizationName);
     QCoreApplication::setOrganizationDomain(Quassel::buildInfo().organizationDomain);
 
-    // on OSX with Qt4, raster seems to fix performance issues
-#if QT_VERSION < 0x050000 && defined Q_OS_MAC && !defined BUILD_CORE
-    QApplication::setGraphicsSystem("raster");
-#endif
-//Setup the High-DPI settings
+    //Setup the High-DPI settings
 # if QT_VERSION >= 0x050600 && defined(Q_OS_WIN)
     QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); //Added in Qt 5.6
 #endif
 # if QT_VERSION >= 0x050600 && defined(Q_OS_WIN)
     QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); //Added in Qt 5.6
 #endif
-# if QT_VERSION >= 0x050400
-   //Added in the early Qt5 versions (5.0?)- use 5.4 as the cutoff since lots of high-DPI work was added then
     QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
     QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
-# endif
+
     // We need to explicitly initialize the required resources when linking statically
 #ifndef BUILD_QTUI
     Q_INIT_RESOURCE(sql);
     // We need to explicitly initialize the required resources when linking statically
 #ifndef BUILD_QTUI
     Q_INIT_RESOURCE(sql);
@@ -134,24 +111,7 @@ int main(int argc, char **argv)
 # endif
 #endif
 
 # endif
 #endif
 
-    std::shared_ptr<AbstractCliParser> cliParser;
-
-#ifdef HAVE_KDE4
-    // We need to init KCmdLineArgs first
-    KAboutData aboutData("quassel", "kdelibs4", ki18n("Quassel IRC"), Quassel::buildInfo().plainVersionString.toUtf8(),
-        ki18n("A modern, distributed IRC client"));
-    aboutData.addLicense(KAboutData::License_GPL_V2);
-    aboutData.addLicense(KAboutData::License_GPL_V3);
-    aboutData.setBugAddress("https://bugs.quassel-irc.org/projects/quassel-irc/issues/new");
-    aboutData.setOrganizationDomain(Quassel::buildInfo().organizationDomain.toUtf8());
-    KCmdLineArgs::init(argc, argv, &aboutData);
-
-    cliParser = std::make_shared<KCmdLineWrapper>();
-#elif defined HAVE_QT5
-    cliParser = std::make_shared<Qt5CliParser>();
-#else
-    cliParser = std::make_shared<CliParser>();
-#endif
+    std::shared_ptr<AbstractCliParser> cliParser = std::make_shared<Qt5CliParser>();
     Quassel::setCliParser(cliParser);
 
     // Initialize CLI arguments
     Quassel::setCliParser(cliParser);
 
     // Initialize CLI arguments
@@ -211,14 +171,6 @@ int main(int argc, char **argv)
     cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)");
 #endif
 
     cliParser->addSwitch("enable-experimental-dcc", 0, "Enable highly experimental and unfinished support for CTCP DCC (DANGEROUS)");
 #endif
 
-#ifdef HAVE_KDE4
-    // the KDE version needs this extra call to parse argc/argv before app is instantiated
-    if (!cliParser->init()) {
-        cliParser->usage();
-        return EXIT_FAILURE;
-    }
-#endif
-
 #if defined BUILD_CORE
     CoreApplication app(argc, argv);
 #elif defined BUILD_QTUI
 #if defined BUILD_CORE
     CoreApplication app(argc, argv);
 #elif defined BUILD_QTUI
@@ -227,13 +179,10 @@ int main(int argc, char **argv)
     MonolithicApplication app(argc, argv);
 #endif
 
     MonolithicApplication app(argc, argv);
 #endif
 
-#ifndef HAVE_KDE4
-    // the non-KDE version parses after app has been instantiated
     if (!cliParser->init(app.arguments())) {
         cliParser->usage();
         return EXIT_FAILURE;
     }
     if (!cliParser->init(app.arguments())) {
         cliParser->usage();
         return EXIT_FAILURE;
     }
-#endif
 
 // Migrate settings from KDE4 to KF5 if appropriate
 #ifdef HAVE_KF5
 
 // Migrate settings from KDE4 to KF5 if appropriate
 #ifdef HAVE_KF5
index efc3d8e..e6757b7 100644 (file)
@@ -34,11 +34,7 @@ class NickHighlightMatcher
 {
 public:
     /// Nickname highlighting mode
 {
 public:
     /// Nickname highlighting mode
-#if QT_VERSION >= 0x050000
     enum class HighlightNickType {
     enum class HighlightNickType {
-#else
-    enum HighlightNickType {
-#endif
         NoNick = 0x00,      ///< Don't match any nickname
         CurrentNick = 0x01, ///< Match the current nickname
         AllNicks = 0x02     ///< Match all configured nicknames in the chosen identity
         NoNick = 0x00,      ///< Don't match any nickname
         CurrentNick = 0x01, ///< Match the current nickname
         AllNicks = 0x02     ///< Match all configured nicknames in the chosen identity
index ea1dc3f..3598fa3 100644 (file)
@@ -559,7 +559,7 @@ void Quassel::loadTranslation(const QLocale &locale)
     quasselTranslator->setObjectName("QuasselTr");
     qApp->installTranslator(quasselTranslator);
 
     quasselTranslator->setObjectName("QuasselTr");
     qApp->installTranslator(quasselTranslator);
 
-#if QT_VERSION >= 0x040800 && !defined Q_OS_MAC
+#ifndef Q_OS_MAC
     bool success = qtTranslator->load(locale, QString("qt_"), translationDirPath());
     if (!success)
         qtTranslator->load(locale, QString("qt_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
     bool success = qtTranslator->load(locale, QString("qt_"), translationDirPath());
     if (!success)
         qtTranslator->load(locale, QString("qt_"), QLibraryInfo::location(QLibraryInfo::TranslationsPath));
index 77f7b87..b658677 100644 (file)
@@ -115,11 +115,7 @@ public:
      *
      * This list should be cleaned up after every protocol break, as we can assume them to be present then.
      */
      *
      * This list should be cleaned up after every protocol break, as we can assume them to be present then.
      */
-    #if QT_VERSION >= 0x050000
     enum class Feature : uint32_t {
     enum class Feature : uint32_t {
-    #else
-    enum Feature {
-    #endif
         SynchronizedMarkerLine,
         SaslAuthentication,
         SaslExternal,
         SynchronizedMarkerLine,
         SaslAuthentication,
         SaslExternal,
@@ -138,9 +134,7 @@ public:
         LongTime,                 ///< Serialize time as 64-bit values
         RichMessages,             ///< Real Name and Avatar URL in backlog
         BacklogFilterType,        ///< BacklogManager supports filtering backlog by MessageType
         LongTime,                 ///< Serialize time as 64-bit values
         RichMessages,             ///< Real Name and Avatar URL in backlog
         BacklogFilterType,        ///< BacklogManager supports filtering backlog by MessageType
-#if QT_VERSION >= 0x050500
         EcdsaCertfpKeys,          ///< ECDSA keys for CertFP in identities
         EcdsaCertfpKeys,          ///< ECDSA keys for CertFP in identities
-#endif
         LongMessageId,            ///< 64-bit IDs for messages
         SyncedCoreInfo,           ///< CoreInfo dynamically updated using signals
     };
         LongMessageId,            ///< 64-bit IDs for messages
         SyncedCoreInfo,           ///< CoreInfo dynamically updated using signals
     };
index 5e5f59d..19b9af8 100644 (file)
@@ -96,11 +96,7 @@ void SignalProxy::SignalRelay::attachSignal(QObject *sender, int signalId, const
     }
     else {
         fn = SIGNAL(fakeMethodSignature());
     }
     else {
         fn = SIGNAL(fakeMethodSignature());
-#if QT_VERSION >= 0x050000
         fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).methodSignature());
         fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).methodSignature());
-#else
-        fn = fn.replace("fakeMethodSignature()", sender->metaObject()->method(signalId).signature());
-#endif
     }
 
     _slots[slotId] = Signal(sender, signalId, fn);
     }
 
     _slots[slotId] = Signal(sender, signalId, fn);
@@ -145,11 +141,7 @@ int SignalProxy::SignalRelay::qt_metacall(QMetaObject::Call _c, int _id, void **
             const QList<int> &argTypes = eMeta->argTypes(signal.signalId);
             for (int i = 0; i < argTypes.size(); i++) {
                 if (argTypes[i] == 0) {
             const QList<int> &argTypes = eMeta->argTypes(signal.signalId);
             for (int i = 0; i < argTypes.size(); i++) {
                 if (argTypes[i] == 0) {
-#if QT_VERSION >= 0x050000
                     qWarning() << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(signal.signalId).methodSignature().constData());
                     qWarning() << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(signal.signalId).methodSignature().constData());
-#else
-                    qWarning() << "SignalRelay::qt_metacall(): received invalid data for argument number" << i << "of signal" << QString("%1::%2").arg(caller->metaObject()->className()).arg(caller->metaObject()->method(signal.signalId).signature());
-#endif
                     qWarning() << "                            - make sure all your data types are known by the Qt MetaSystem";
                     return _id;
                 }
                     qWarning() << "                            - make sure all your data types are known by the Qt MetaSystem";
                     return _id;
                 }
@@ -669,11 +661,7 @@ bool SignalProxy::invokeSlot(QObject *receiver, int methodId, const QVariantList
     // check for argument compatibility and build params array
     for (int i = 0; i < numArgs; i++) {
         if (!params[i].isValid()) {
     // check for argument compatibility and build params array
     for (int i = 0; i < numArgs; i++) {
         if (!params[i].isValid()) {
-#if QT_VERSION >= 0x050000
             qWarning() << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).methodSignature().constData());
             qWarning() << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).methodSignature().constData());
-#else
-            qWarning() << "SignalProxy::invokeSlot(): received invalid data for argument number" << i << "of method" << QString("%1::%2()").arg(receiver->metaObject()->className()).arg(receiver->metaObject()->method(methodId).signature());
-#endif
             qWarning() << "                            - make sure all your data types are known by the Qt MetaSystem";
             return false;
         }
             qWarning() << "                            - make sure all your data types are known by the Qt MetaSystem";
             return false;
         }
@@ -896,11 +884,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo
         if (_meta->method(i).methodType() != QMetaMethod::Slot)
             continue;
 
         if (_meta->method(i).methodType() != QMetaMethod::Slot)
             continue;
 
-#if QT_VERSION >= 0x050000
         if (_meta->method(i).methodSignature().contains('*'))
         if (_meta->method(i).methodSignature().contains('*'))
-#else
-        if (QByteArray(_meta->method(i).signature()).contains('*'))
-#endif
             continue;  // skip methods with ptr params
 
         QByteArray method = methodName(_meta->method(i));
             continue;  // skip methods with ptr params
 
         QByteArray method = methodName(_meta->method(i));
@@ -929,11 +913,7 @@ SignalProxy::ExtendedMetaObject::ExtendedMetaObject(const QMetaObject *meta, boo
             }
             if (checkConflicts) {
                 qWarning() << "class" << meta->className() << "contains overloaded methods which is currently not supported!";
             }
             if (checkConflicts) {
                 qWarning() << "class" << meta->className() << "contains overloaded methods which is currently not supported!";
-#if QT_VERSION >= 0x050000
                 qWarning() << " - " << _meta->method(i).methodSignature() << "conflicts with" << _meta->method(_methodIds[method]).methodSignature();
                 qWarning() << " - " << _meta->method(i).methodSignature() << "conflicts with" << _meta->method(_methodIds[method]).methodSignature();
-#else
-                qWarning() << " - " << _meta->method(i).signature() << "conflicts with" << _meta->method(_methodIds[method]).signature();
-#endif
             }
             continue;
         }
             }
             continue;
         }
@@ -973,11 +953,7 @@ const QHash<int, int> &SignalProxy::ExtendedMetaObject::receiveMap()
             if (QMetaType::Void == (QMetaType::Type)returnType(i))
                 continue;
 
             if (QMetaType::Void == (QMetaType::Type)returnType(i))
                 continue;
 
-#if QT_VERSION >= 0x050000
             signature = requestSlot.methodSignature();
             signature = requestSlot.methodSignature();
-#else
-            signature = QByteArray(requestSlot.signature());
-#endif
             if (!signature.startsWith("request"))
                 continue;
 
             if (!signature.startsWith("request"))
                 continue;
 
@@ -1011,22 +987,14 @@ const QHash<int, int> &SignalProxy::ExtendedMetaObject::receiveMap()
 
 QByteArray SignalProxy::ExtendedMetaObject::methodName(const QMetaMethod &method)
 {
 
 QByteArray SignalProxy::ExtendedMetaObject::methodName(const QMetaMethod &method)
 {
-#if QT_VERSION >= 0x050000
     QByteArray sig(method.methodSignature());
     QByteArray sig(method.methodSignature());
-#else
-    QByteArray sig(method.signature());
-#endif
     return sig.left(sig.indexOf("("));
 }
 
 
 QString SignalProxy::ExtendedMetaObject::methodBaseName(const QMetaMethod &method)
 {
     return sig.left(sig.indexOf("("));
 }
 
 
 QString SignalProxy::ExtendedMetaObject::methodBaseName(const QMetaMethod &method)
 {
-#if QT_VERSION >= 0x050000
     QString methodname = QString(method.methodSignature()).section("(", 0, 0);
     QString methodname = QString(method.methodSignature()).section("(", 0, 0);
-#else
-    QString methodname = QString(method.signature()).section("(", 0, 0);
-#endif
 
     // determine where we have to chop:
     int upperCharPos;
 
     // determine where we have to chop:
     int upperCharPos;
@@ -1064,11 +1032,7 @@ SignalProxy::ExtendedMetaObject::MethodDescriptor::MethodDescriptor(const QMetaM
     _argTypes = argTypes;
 
     // determine minArgCount
     _argTypes = argTypes;
 
     // determine minArgCount
-#if QT_VERSION >= 0x050000
     QString signature(method.methodSignature());
     QString signature(method.methodSignature());
-#else
-    QString signature(method.signature());
-#endif
     _minArgCount = method.parameterTypes().count() - signature.count("=");
 
     _receiverMode = (_methodName.startsWith("request"))
     _minArgCount = method.parameterTypes().count() - signature.count("=");
 
     _receiverMode = (_methodName.startsWith("request"))
index f24882c..f3ea4c5 100644 (file)
@@ -98,12 +98,10 @@ public:
     }
 
     //A better version, but only implemented on Qt5 if Initializer Lists exist
     }
 
     //A better version, but only implemented on Qt5 if Initializer Lists exist
-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 #ifdef Q_COMPILER_INITIALIZER_LISTS
     void restrictTargetPeers(std::initializer_list<Peer*> peers, std::function<void()> closure) {
         restrictTargetPeers(QSet<Peer*>(peers), std::move(closure));
     }
 #ifdef Q_COMPILER_INITIALIZER_LISTS
     void restrictTargetPeers(std::initializer_list<Peer*> peers, std::function<void()> closure) {
         restrictTargetPeers(QSet<Peer*>(peers), std::move(closure));
     }
-#endif
 #endif
     /**}@*/
 
 #endif
     /**}@*/
 
index a2d092e..ba05014 100644 (file)
@@ -114,11 +114,7 @@ QVariantMap SyncableObject::toVariantMap()
 
         QVariant::Type variantType = QVariant::nameToType(method.typeName());
         if (variantType == QVariant::Invalid && !QByteArray(method.typeName()).isEmpty()) {
 
         QVariant::Type variantType = QVariant::nameToType(method.typeName());
         if (variantType == QVariant::Invalid && !QByteArray(method.typeName()).isEmpty()) {
-#if QT_VERSION >= 0x050000
             qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName());
             qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.methodSignature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName());
-#else
-            qWarning() << "SyncableObject::toVariantMap(): cannot fetch init data for:" << this << method.signature() << "- Returntype is unknown to Qt's MetaSystem:" << QByteArray(method.typeName());
-#endif
             continue;
         }
 
             continue;
         }
 
index b7cd6d0..840edbd 100644 (file)
@@ -77,10 +77,8 @@ void CoreIdentity::synchronize(SignalProxy *proxy)
 void CoreIdentity::setSslKey(const QByteArray &encoded)
 {
     QSslKey key(encoded, QSsl::Rsa);
 void CoreIdentity::setSslKey(const QByteArray &encoded)
 {
     QSslKey key(encoded, QSsl::Rsa);
-#if QT_VERSION >= 0x050500
     if (key.isNull())
         key = QSslKey(encoded, QSsl::Ec);
     if (key.isNull())
         key = QSslKey(encoded, QSsl::Ec);
-#endif
     if (key.isNull())
         key = QSslKey(encoded, QSsl::Dsa);
     setSslKey(key);
     if (key.isNull())
         key = QSslKey(encoded, QSsl::Dsa);
     setSslKey(key);
index 29efd4b..d060ada 100644 (file)
 #  include "cipher.h"
 #endif
 
 #  include "cipher.h"
 #endif
 
-#if QT_VERSION < 0x050000
-// QChar::LineFeed is Qt 5
-static const QChar QCharLF = QChar('\n');
-#else
-static const QChar QCharLF = QChar::LineFeed;
-#endif
-
 CoreUserInputHandler::CoreUserInputHandler(CoreNetwork *parent)
     : CoreBasicHandler(parent)
 {
 CoreUserInputHandler::CoreUserInputHandler(CoreNetwork *parent)
     : CoreBasicHandler(parent)
 {
@@ -457,7 +450,7 @@ void CoreUserInputHandler::handleMe(const BufferInfo &bufferInfo, const QString
 
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
 
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
-    QStringList messages = msg.split(QCharLF);
+    QStringList messages = msg.split(QChar::LineFeed);
 
     foreach (auto message, messages) {
         // Handle each separated message independently
 
     foreach (auto message, messages) {
         // Handle each separated message independently
@@ -532,7 +525,7 @@ void CoreUserInputHandler::handleNotice(const BufferInfo &bufferInfo, const QStr
     QList<QByteArray> params;
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
     QList<QByteArray> params;
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
-    QStringList messages = msg.section(' ', 1).split(QCharLF);
+    QStringList messages = msg.section(' ', 1).split(QChar::LineFeed);
 
     foreach (auto message, messages) {
         // Handle each separated message independently
 
     foreach (auto message, messages) {
         // Handle each separated message independently
@@ -606,7 +599,7 @@ void CoreUserInputHandler::handleQuery(const BufferInfo &bufferInfo, const QStri
     QString target = msg.section(' ', 0, 0);
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
     QString target = msg.section(' ', 0, 0);
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
-    QStringList messages = msg.section(' ', 1).split(QCharLF);
+    QStringList messages = msg.section(' ', 1).split(QChar::LineFeed);
 
     foreach (auto message, messages) {
         // Handle each separated message independently
 
     foreach (auto message, messages) {
         // Handle each separated message independently
@@ -657,7 +650,7 @@ void CoreUserInputHandler::handleSay(const BufferInfo &bufferInfo, const QString
 
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
 
     // Split apart messages at line feeds.  The IRC protocol uses those to separate commands, so
     // they need to be split into multiple messages.
-    QStringList messages = msg.split(QCharLF, QString::SkipEmptyParts);
+    QStringList messages = msg.split(QChar::LineFeed, QString::SkipEmptyParts);
 
     foreach (auto message, messages) {
         // Handle each separated message independently
 
     foreach (auto message, messages) {
         // Handle each separated message independently
index 183bbe1..a1e090b 100644 (file)
@@ -71,11 +71,8 @@ QTcpSocket *SslServer::nextPendingConnection()
         return _pendingConnections.takeFirst();
 }
 
         return _pendingConnections.takeFirst();
 }
 
-#if QT_VERSION >= 0x050000
+
 void SslServer::incomingConnection(qintptr socketDescriptor)
 void SslServer::incomingConnection(qintptr socketDescriptor)
-#else
-void SslServer::incomingConnection(int socketDescriptor)
-#endif
 {
     QSslSocket *serverSocket = new QSslSocket(this);
     if (serverSocket->setSocketDescriptor(socketDescriptor)) {
 {
     QSslSocket *serverSocket = new QSslSocket(this);
     if (serverSocket->setSocketDescriptor(socketDescriptor)) {
@@ -196,20 +193,16 @@ bool SslServer::setCertificate(const QString &path, const QString &keyPath)
 
     // We allow the core to offer SSL anyway, so no "return false" here. Client will warn about the cert being invalid.
     const QDateTime now = QDateTime::currentDateTime();
 
     // We allow the core to offer SSL anyway, so no "return false" here. Client will warn about the cert being invalid.
     const QDateTime now = QDateTime::currentDateTime();
-    if (now < untestedCert.effectiveDate())
+    if (now < untestedCert.effectiveDate()) {
         quWarning() << "SslServer: Certificate won't be valid before" << untestedCert.effectiveDate().toString();
         quWarning() << "SslServer: Certificate won't be valid before" << untestedCert.effectiveDate().toString();
-
-    else if (now > untestedCert.expiryDate())
+    }
+    else if (now > untestedCert.expiryDate()) {
         quWarning() << "SslServer: Certificate expired on" << untestedCert.expiryDate().toString();
         quWarning() << "SslServer: Certificate expired on" << untestedCert.expiryDate().toString();
-
-    else { // Qt4's isValid() checks for time range and blacklist; avoid a double warning, hence the else block
-#if QT_VERSION < 0x050000
-        if (!untestedCert.isValid())
-#else
-        if (untestedCert.isBlacklisted())
-#endif
-            quWarning() << "SslServer: Certificate blacklisted";
     }
     }
+    else if (untestedCert.isBlacklisted()) {
+        quWarning() << "SslServer: Certificate blacklisted";
+    }
+
     if (untestedKey.isNull()) {
         quWarning() << "SslServer:" << qPrintable(keyPath) << "contains no key data";
         return false;
     if (untestedKey.isNull()) {
         quWarning() << "SslServer:" << qPrintable(keyPath) << "contains no key data";
         return false;
@@ -230,7 +223,6 @@ QSslKey SslServer::loadKey(QFile *keyFile)
 {
     QSslKey key;
     key = QSslKey(keyFile, QSsl::Rsa);
 {
     QSslKey key;
     key = QSslKey(keyFile, QSsl::Rsa);
-#if QT_VERSION >= 0x050500
     if (key.isNull()) {
         if (!keyFile->reset()) {
             quWarning() << "SslServer: IO error reading key file";
     if (key.isNull()) {
         if (!keyFile->reset()) {
             quWarning() << "SslServer: IO error reading key file";
@@ -238,7 +230,6 @@ QSslKey SslServer::loadKey(QFile *keyFile)
         }
         key = QSslKey(keyFile, QSsl::Ec);
     }
         }
         key = QSslKey(keyFile, QSsl::Ec);
     }
-#endif
     return key;
 }
 
     return key;
 }
 
index 609ec77..518db2e 100644 (file)
@@ -53,11 +53,7 @@ public:
     bool reloadCerts();
 
 protected:
     bool reloadCerts();
 
 protected:
-#if QT_VERSION >= 0x050000
     void incomingConnection(qintptr socketDescriptor) override;
     void incomingConnection(qintptr socketDescriptor) override;
-#else
-    void incomingConnection(int socketDescriptor) override;
-#endif
 
     bool setCertificate(const QString &path, const QString &keyPath);
 
 
     bool setCertificate(const QString &path, const QString &keyPath);
 
index d6c0ba5..9289256 100644 (file)
 
 #include "storage.h"
 
 
 #include "storage.h"
 
-#include <QCryptographicHash>
 #include <random>
 
 #include <random>
 
-#if QT_VERSION < 0x050000
-#    include "../../3rdparty/sha512/sha512.h"
-#endif
+#include <QCryptographicHash>
 
 Storage::Storage(QObject *parent)
     : QObject(parent)
 
 Storage::Storage(QObject *parent)
     : QObject(parent)
@@ -40,7 +37,7 @@ QString Storage::hashPassword(const QString &password)
 bool Storage::checkHashedPassword(const UserId user, const QString &password, const QString &hashedPassword, const Storage::HashVersion version)
 {
     bool passwordCorrect = false;
 bool Storage::checkHashedPassword(const UserId user, const QString &password, const QString &hashedPassword, const Storage::HashVersion version)
 {
     bool passwordCorrect = false;
-    
+
     switch (version) {
     case Storage::HashVersion::Sha1:
         passwordCorrect = checkHashedPasswordSha1(password, hashedPassword);
     switch (version) {
     case Storage::HashVersion::Sha1:
         passwordCorrect = checkHashedPasswordSha1(password, hashedPassword);
@@ -53,11 +50,11 @@ bool Storage::checkHashedPassword(const UserId user, const QString &password, co
     default:
         qWarning() << "Password hash version" << QString(version) << "is not supported, please reset password";
     }
     default:
         qWarning() << "Password hash version" << QString(version) << "is not supported, please reset password";
     }
-    
+
     if (passwordCorrect && version < Storage::HashVersion::Latest) {
         updateUser(user, password);
     }
     if (passwordCorrect && version < Storage::HashVersion::Latest) {
         updateUser(user, password);
     }
-    
+
     return passwordCorrect;
 }
 
     return passwordCorrect;
 }
 
@@ -104,12 +101,5 @@ bool Storage::checkHashedPasswordSha2_512(const QString &password, const QString
 
 QString Storage::sha2_512(const QString &input)
 {
 
 QString Storage::sha2_512(const QString &input)
 {
-#if QT_VERSION >= 0x050000
     return QString(QCryptographicHash::hash(input.toUtf8(), QCryptographicHash::Sha512).toHex());
     return QString(QCryptographicHash::hash(input.toUtf8(), QCryptographicHash::Sha512).toHex());
-#else
-    QByteArray inputBytes = input.toUtf8();
-    unsigned char output[64];
-    sha512((unsigned char*) inputBytes.constData(), inputBytes.size(), output, false);
-    return QString(QByteArray::fromRawData((char*) output, 64).toHex());
-#endif
 }
 }
index 92ad372..02f5fac 100644 (file)
 #include <QPersistentModelIndex>
 #include <QUrl>
 
 #include <QPersistentModelIndex>
 #include <QUrl>
 
-#ifdef HAVE_KDE4
-#  include <KMenuBar>
-#else
-#  include <QMenuBar>
-#endif
-
 #ifdef HAVE_WEBENGINE
 #  include <QWebEngineView>
 #elif defined HAVE_WEBKIT
 #ifdef HAVE_WEBENGINE
 #  include <QWebEngineView>
 #elif defined HAVE_WEBKIT
index 704b3be..2370311 100644 (file)
@@ -109,11 +109,7 @@ bool ChatView::event(QEvent *event)
         }
     }
 
         }
     }
 
-#if QT_VERSION >= 0x050000
-    if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type()==QTouchDevice::TouchScreen) {
-#else
-    if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->deviceType()==QTouchEvent::TouchScreen) {
-#endif
+    if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type() == QTouchDevice::TouchScreen) {
         // Enable scrolling by draging, disable selecting/clicking content
         setDragMode(QGraphicsView::ScrollHandDrag);
         setInteractive(false);
         // Enable scrolling by draging, disable selecting/clicking content
         setDragMode(QGraphicsView::ScrollHandDrag);
         setInteractive(false);
@@ -122,11 +118,7 @@ bool ChatView::event(QEvent *event)
         if (verticalScrollBar()->isVisible()) return true;
     }
 
         if (verticalScrollBar()->isVisible()) return true;
     }
 
-#if QT_VERSION >= 0x050000
     if (event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel) {
     if (event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel) {
-#else
-    if (event->type() == QEvent::TouchEnd) {
-#endif
         // End scroll and reset settings to default
         setDragMode(QGraphicsView::NoDrag);
         setInteractive(true);
         // End scroll and reset settings to default
         setDragMode(QGraphicsView::NoDrag);
         setInteractive(true);
@@ -149,11 +141,7 @@ bool ChatView::event(QEvent *event)
         }
         // Applying the movement happens automatically by the drag-mode
     }
         }
         // Applying the movement happens automatically by the drag-mode
     }
-#if QT_VERSION >= 0x050000
-    if (event->type() == QEvent::Wheel || (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type()==QTouchDevice::TouchScreen) || event->type() == QEvent::TouchUpdate) {
-#else
-    if (event->type() == QEvent::Wheel || (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->deviceType()==QTouchEvent::TouchScreen) || event->type() == QEvent::TouchUpdate) {
-#endif
+    if (event->type() == QEvent::Wheel || (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type() == QTouchDevice::TouchScreen) || event->type() == QEvent::TouchUpdate) {
         if (!verticalScrollBar()->isVisible()) {
             scene()->requestBacklog();
             return true;
         if (!verticalScrollBar()->isVisible()) {
             scene()->requestBacklog();
             return true;
index d2a9dd8..b85d355 100644 (file)
@@ -90,14 +90,10 @@ private:
 class SearchHighlightItem : public QObject, public QGraphicsItem
 {
     Q_OBJECT
 class SearchHighlightItem : public QObject, public QGraphicsItem
 {
     Q_OBJECT
-
-// Apparently, there are broken Qt 4.8.2 mocs around that will fail without this (otherwise useless) #if... looking at you, Wheezy!
-#if QT_VERSION >= 0x040600
     Q_INTERFACES(QGraphicsItem)
     Q_INTERFACES(QGraphicsItem)
-#endif
 
 
-public :
-        SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0);
+public:
+    SearchHighlightItem(QRectF wordRect, QGraphicsItem *parent = 0);
     virtual inline QRectF boundingRect() const { return _boundingRect; }
     void updateGeometry(qreal width, qreal height);
     virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
     virtual inline QRectF boundingRect() const { return _boundingRect; }
     void updateGeometry(qreal width, qreal height);
     virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
index 8225fe4..ebb23b8 100644 (file)
@@ -318,11 +318,7 @@ AuthenticationSelectionPage::AuthenticationSelectionPage(const QVariantList &aut
     setSizePolicy({QSizePolicy::Fixed, QSizePolicy::Fixed});
 
     QSizePolicy sp{QSizePolicy::MinimumExpanding, QSizePolicy::Fixed};
     setSizePolicy({QSizePolicy::Fixed, QSizePolicy::Fixed});
 
     QSizePolicy sp{QSizePolicy::MinimumExpanding, QSizePolicy::Fixed};
-#if QT_VERSION >= 0x050200
     sp.setRetainSizeWhenHidden(true);
     sp.setRetainSizeWhenHidden(true);
-#else
-    ui.authSettingsStack->setVisible(true);  // ugly hack that will show an empty box, but we'll deprecate Qt4 soon anyway
-#endif
     ui.descriptionStack->setSizePolicy(sp);
     ui.authSettingsStack->setSizePolicy(sp);
 
     ui.descriptionStack->setSizePolicy(sp);
     ui.authSettingsStack->setSizePolicy(sp);
 
@@ -347,11 +343,7 @@ QString AuthenticationSelectionPage::displayName() const
 
 QString AuthenticationSelectionPage::authenticator() const
 {
 
 QString AuthenticationSelectionPage::authenticator() const
 {
-#if QT_VERSION >= 0x050200
     return ui.backendList->currentData().toString();
     return ui.backendList->currentData().toString();
-#else
-    return ui.backendList->itemData(ui.backendList->currentIndex()).toString();
-#endif
 }
 
 
 }
 
 
@@ -424,11 +416,7 @@ StorageSelectionPage::StorageSelectionPage(const QVariantList &backendInfos, QWi
     setSizePolicy({QSizePolicy::Fixed, QSizePolicy::Fixed});
 
     QSizePolicy sp{QSizePolicy::MinimumExpanding, QSizePolicy::Fixed};
     setSizePolicy({QSizePolicy::Fixed, QSizePolicy::Fixed});
 
     QSizePolicy sp{QSizePolicy::MinimumExpanding, QSizePolicy::Fixed};
-#if QT_VERSION >= 0x050200
     sp.setRetainSizeWhenHidden(true);
     sp.setRetainSizeWhenHidden(true);
-#else
-    ui.storageSettingsStack->setVisible(true);  // ugly hack that will show an empty box, but we'll deprecate Qt4 soon anyway
-#endif
     ui.descriptionStack->setSizePolicy(sp);
     ui.storageSettingsStack->setSizePolicy(sp);
 
     ui.descriptionStack->setSizePolicy(sp);
     ui.storageSettingsStack->setSizePolicy(sp);
 
@@ -453,11 +441,7 @@ QString StorageSelectionPage::displayName() const
 
 QString StorageSelectionPage::backend() const
 {
 
 QString StorageSelectionPage::backend() const
 {
-#if QT_VERSION >= 0x050200
     return ui.backendList->currentData().toString();
     return ui.backendList->currentData().toString();
-#else
-    return ui.backendList->itemData(ui.backendList->currentIndex()).toString();
-#endif
 }
 
 
 }
 
 
index e7ba2d4..9ca881e 100644 (file)
 #include <QTextDocument>
 #include <QVBoxLayout>
 
 #include <QTextDocument>
 #include <QVBoxLayout>
 
-#ifdef HAVE_KDE4
-#  include <KNotification>
-#  include <KNotifyConfigWidget>
-#else
-#  include <KNotifications/KNotification>
-#  include <KNotifyConfig/KNotifyConfigWidget>
-#endif
+#include <KNotifications/KNotification>
+#include <KNotifyConfig/KNotifyConfigWidget>
 
 #include "client.h"
 #include "icon.h"
 
 #include "client.h"
 #include "icon.h"
@@ -61,11 +56,7 @@ void KNotificationBackend::notify(const Notification &n)
         type = "PrivMsgFocused"; break;
     }
 
         type = "PrivMsgFocused"; break;
     }
 
-#if QT_VERSION < 0x050000
-    QString message = QString("<b>&lt;%1&gt;</b> %2").arg(n.sender, Qt::escape(n.message));
-#else
     QString message = QString("<b>&lt;%1&gt;</b> %2").arg(n.sender, n.message.toHtmlEscaped());
     QString message = QString("<b>&lt;%1&gt;</b> %2").arg(n.sender, n.message.toHtmlEscaped());
-#endif
     KNotification *notification = KNotification::event(type, message, icon::get("dialog-information").pixmap(48), QtUi::mainWindow(),
         KNotification::RaiseWidgetOnActivation
         |KNotification::CloseWhenWidgetActivated
     KNotification *notification = KNotification::event(type, message, icon::get("dialog-information").pixmap(48), QtUi::mainWindow(),
         KNotification::RaiseWidgetOnActivation
         |KNotification::CloseWhenWidgetActivated
index 40cd2ed..87ff3df 100644 (file)
 
 LegacySystemTray::LegacySystemTray(QWidget *parent)
     : SystemTray(parent)
 
 LegacySystemTray::LegacySystemTray(QWidget *parent)
     : SystemTray(parent)
+    , _trayIcon{new QSystemTrayIcon(associatedWidget())}
 {
 {
-#ifndef HAVE_KDE4
-    _trayIcon = new QSystemTrayIcon(associatedWidget());
-#else
-    _trayIcon = new KSystemTrayIcon(associatedWidget());
-    // We don't want to trigger a minimize if a highlight is pending, so we brutally remove the internal connection for that
-    disconnect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
-        _trayIcon, SLOT(activateOrHide(QSystemTrayIcon::ActivationReason)));
-#endif
+
 #ifndef Q_OS_MAC
     connect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
         SLOT(onActivated(QSystemTrayIcon::ActivationReason)));
 #ifndef Q_OS_MAC
     connect(_trayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)),
         SLOT(onActivated(QSystemTrayIcon::ActivationReason)));
index e2bc338..8ef478e 100644 (file)
 #ifndef QT_NO_SYSTEMTRAYICON
 
 #include <QString>
 #ifndef QT_NO_SYSTEMTRAYICON
 
 #include <QString>
-
-#ifdef HAVE_KDE4
-#  include <KSystemTrayIcon>
-#else
-#  include <QSystemTrayIcon>
-#endif
+#include <QSystemTrayIcon>
 
 #include "systemtray.h"
 
 
 #include "systemtray.h"
 
@@ -58,11 +53,7 @@ private slots:
 private:
     uint _lastMessageId {0};
 
 private:
     uint _lastMessageId {0};
 
-#ifdef HAVE_KDE4
-    KSystemTrayIcon *_trayIcon;
-#else
     QSystemTrayIcon *_trayIcon;
     QSystemTrayIcon *_trayIcon;
-#endif
 };
 
 #endif /* QT_NO_SYSTEMTRAYICON */
 };
 
 #endif /* QT_NO_SYSTEMTRAYICON */
index 77e693a..f2c1388 100644 (file)
 #include <QToolBar>
 #include <QInputDialog>
 
 #include <QToolBar>
 #include <QInputDialog>
 
-#ifdef HAVE_KDE4
-#  include <KHelpMenu>
-#  include <KMenuBar>
-#  include <KShortcutsDialog>
-#  include <KStatusBar>
-#  include <KToggleFullScreenAction>
-#  include <KToolBar>
-#endif
-
 #ifdef HAVE_KF5
 #  include <KConfigWidgets/KStandardAction>
 #  include <KXmlGui/KHelpMenu>
 #ifdef HAVE_KF5
 #  include <KConfigWidgets/KStandardAction>
 #  include <KXmlGui/KHelpMenu>
index 505bb61..9b42250 100644 (file)
@@ -22,9 +22,7 @@
 
 #include <QUuid>
 
 
 #include <QUuid>
 
-#ifdef HAVE_KDE4
-#  include <KMainWindow>
-#elif defined HAVE_KF5
+#ifdef HAVE_KF5
 #  include <KXmlGui/KMainWindow>
 #else
 #  include <QMainWindow>
 #  include <KXmlGui/KMainWindow>
 #else
 #  include <QMainWindow>
index a6c48c3..9bd8157 100644 (file)
@@ -347,7 +347,6 @@ void QtUi::refreshIconTheme()
         return;
     }
 
         return;
     }
 
-#if QT_VERSION >= 0x050000
     // At this point, we have a system theme that we don't want to override, but that may not contain all
     // required icons.
     // We create a dummy theme that inherits first from the system theme, then from the supported fallback.
     // At this point, we have a system theme that we don't want to override, but that may not contain all
     // required icons.
     // We create a dummy theme that inherits first from the system theme, then from the supported fallback.
@@ -397,10 +396,4 @@ void QtUi::refreshIconTheme()
     }
     indexFile.close();
     QIcon::setThemeName("quassel-icon-proxy");
     }
     indexFile.close();
     QIcon::setThemeName("quassel-icon-proxy");
-#else
-    // Qt4 doesn't support QTemporaryDir. Since it's deprecated and slated to be removed soon anyway, we don't bother
-    // writing a replacement and simply don't support not overriding the system theme.
-    QIcon::setThemeName(fallbackTheme);
-    emit iconThemeRefreshed();
-#endif
 }
 }
index af9ddff..a6551a8 100644 (file)
 #include <QList>
 #include <QObject>
 #include <QString>
 #include <QList>
 #include <QObject>
 #include <QString>
-
-#if QT_VERSION >= 0x050000
-#  include <QTemporaryDir>
-#endif
+#include <QTemporaryDir>
 
 #include "abstractnotificationbackend.h"
 #include "graphicalui.h"
 
 #include "abstractnotificationbackend.h"
 #include "graphicalui.h"
@@ -136,9 +133,7 @@ private:
 
     QString _systemIconTheme;
 
 
     QString _systemIconTheme;
 
-#if QT_VERSION >= 0x050000
     std::unique_ptr<QTemporaryDir> _dummyThemeDir;
     std::unique_ptr<QTemporaryDir> _dummyThemeDir;
-#endif
 
     bool _useSystemTray;
 };
 
     bool _useSystemTray;
 };
index fc04f59..74be5b4 100644 (file)
 #include <QFile>
 #include <QStringList>
 
 #include <QFile>
 #include <QStringList>
 
-#ifdef HAVE_KDE4
-#  include <KStandardDirs>
-#endif
-
 #include "chatviewsettings.h"
 #include "cliparser.h"
 #include "logmessage.h"
 #include "chatviewsettings.h"
 #include "cliparser.h"
 #include "logmessage.h"
 #include "types.h"
 
 QtUiApplication::QtUiApplication(int &argc, char **argv)
 #include "types.h"
 
 QtUiApplication::QtUiApplication(int &argc, char **argv)
-#ifdef HAVE_KDE4
-    : KApplication()  // KApplication is deprecated in KF5
-#else
     : QApplication(argc, argv)
     : QApplication(argc, argv)
-#endif
 {
 {
-#ifdef HAVE_KDE4
-    Q_UNUSED(argc); Q_UNUSED(argv);
-
-    // Setup KDE's data dirs
-    // Because we can't use KDE stuff in (the class) Quassel directly, we need to do this here...
-    QStringList dataDirs = KGlobal::dirs()->findDirs("data", "");
-
-    // Just in case, also check our install prefix
-    dataDirs << QCoreApplication::applicationDirPath() + "/../share/apps/";
-
-    // Normalize and append our application name
-    for (int i = 0; i < dataDirs.count(); i++)
-        dataDirs[i] = QDir::cleanPath(dataDirs.at(i)) + "/quassel/";
-
-    // Add resource path and just in case.
-    // Workdir should have precedence
-    dataDirs.prepend(QCoreApplication::applicationDirPath() + "/data/");
-    dataDirs.append(":/data/");
-
-    // Append trailing '/' and check for existence
-    auto iter = dataDirs.begin();
-    while (iter != dataDirs.end()) {
-        if (!iter->endsWith(QDir::separator()) && !iter->endsWith('/'))
-            iter->append(QDir::separator());
-        if (!QFile::exists(*iter))
-            iter = dataDirs.erase(iter);
-        else
-            ++iter;
-    }
-
-    dataDirs.removeDuplicates();
-    Quassel::setDataDirPaths(dataDirs);
-
-#else /* HAVE_KDE4 */
-
     Quassel::setDataDirPaths(Quassel::findDataDirPaths());
     Quassel::setDataDirPaths(Quassel::findDataDirPaths());
-
-#endif /* HAVE_KDE4 */
-
     Quassel::setRunMode(Quassel::ClientOnly);
 
     Quassel::setRunMode(Quassel::ClientOnly);
 
-#if QT_VERSION >= 0x050000
     connect(this, &QGuiApplication::commitDataRequest, this, &QtUiApplication::commitData, Qt::DirectConnection);
     connect(this, &QGuiApplication::saveStateRequest, this, &QtUiApplication::saveState, Qt::DirectConnection);
     connect(this, &QGuiApplication::commitDataRequest, this, &QtUiApplication::commitData, Qt::DirectConnection);
     connect(this, &QGuiApplication::saveStateRequest, this, &QtUiApplication::saveState, Qt::DirectConnection);
-#endif
 
 
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
+#if QT_VERSION >= 0x050600
     QGuiApplication::setFallbackSessionManagementEnabled(false);
 #endif
 }
     QGuiApplication::setFallbackSessionManagementEnabled(false);
 #endif
 }
index a5e68e1..8d8608e 100644 (file)
 
 #include <memory>
 
 
 #include <memory>
 
-#ifdef HAVE_KDE4
-#  include <KApplication>
-#else
-#  include <QApplication>
-#endif
-
+#include <QApplication>
 #include <QSessionManager>
 
 #include "client.h"
 #include <QSessionManager>
 
 #include "client.h"
 
 class QtUi;
 
 
 class QtUi;
 
-#ifdef HAVE_KDE4
-class QtUiApplication : public KApplication
-{
-#else
 class QtUiApplication : public QApplication
 {
 class QtUiApplication : public QApplication
 {
-#endif
-
     Q_OBJECT
 
 public:
     Q_OBJECT
 
 public:
@@ -55,13 +44,8 @@ public:
     void resumeSessionIfPossible();
     inline bool isAboutToQuit() const { return _aboutToQuit; }
 
     void resumeSessionIfPossible();
     inline bool isAboutToQuit() const { return _aboutToQuit; }
 
-#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
-    void commitData(QSessionManager &manager) override;
-    void saveState(QSessionManager &manager) override;
-#else
     void commitData(QSessionManager &manager);
     void saveState(QSessionManager &manager);
     void commitData(QSessionManager &manager);
     void saveState(QSessionManager &manager);
-#endif
 
 protected:
     virtual Quassel::QuitHandler quitHandler();
 
 protected:
     virtual Quassel::QuitHandler quitHandler();
index 1a25533..f5360c3 100644 (file)
@@ -40,10 +40,6 @@ AppearanceSettingsPage::AppearanceSettingsPage(QWidget *parent)
 #ifdef QT_NO_SYSTEMTRAYICON
     ui.useSystemTrayIcon->hide();
 #endif
 #ifdef QT_NO_SYSTEMTRAYICON
     ui.useSystemTrayIcon->hide();
 #endif
-#if QT_VERSION < 0x050000
-    // We don't support overriding the system icon theme with Qt4
-    ui.overrideSystemIconTheme->hide();
-#endif
 
     // If no system icon theme is given, showing the override option makes no sense.
     // Also don't mention a "fallback".
 
     // If no system icon theme is given, showing the override option makes no sense.
     // Also don't mention a "fallback".
index 3de8d76..9315f3f 100644 (file)
@@ -136,21 +136,12 @@ void CoreHighlightSettingsPage::setupRuleTable(QTableWidget *table) const
                        table->horizontalHeaderItem(CoreHighlightSettingsPage::SenderColumn),
                        table->horizontalHeaderItem(CoreHighlightSettingsPage::ChanColumn));
 
                        table->horizontalHeaderItem(CoreHighlightSettingsPage::SenderColumn),
                        table->horizontalHeaderItem(CoreHighlightSettingsPage::ChanColumn));
 
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
-    table->horizontalHeader()->setResizeMode(CoreHighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
-    table->horizontalHeader()->setResizeMode(CoreHighlightSettingsPage::NameColumn, QHeaderView::Stretch);
-    table->horizontalHeader()->setResizeMode(CoreHighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
-    table->horizontalHeader()->setResizeMode(CoreHighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
-    table->horizontalHeader()->setResizeMode(CoreHighlightSettingsPage::SenderColumn, QHeaderView::ResizeToContents);
-    table->horizontalHeader()->setResizeMode(CoreHighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
-#else
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::NameColumn, QHeaderView::Stretch);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::SenderColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::NameColumn, QHeaderView::Stretch);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::SenderColumn, QHeaderView::ResizeToContents);
     table->horizontalHeader()->setSectionResizeMode(CoreHighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
-#endif
 }
 
 
 }
 
 
index db5982e..59ffac3 100644 (file)
@@ -79,19 +79,11 @@ HighlightSettingsPage::HighlightSettingsPage(QWidget *parent)
     ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis(
                 ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->toolTip());
 
     ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->setWhatsThis(
                 ui.highlightTable->horizontalHeaderItem(HighlightSettingsPage::ChanColumn)->toolTip());
 
-#if QT_VERSION < 0x050000
-    ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
-    ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
-    ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
-    ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
-    ui.highlightTable->horizontalHeader()->setResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
-#else
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::NameColumn, QHeaderView::Stretch);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::RegExColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::CsColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::EnableColumn, QHeaderView::ResizeToContents);
     ui.highlightTable->horizontalHeader()->setSectionResizeMode(HighlightSettingsPage::ChanColumn, QHeaderView::ResizeToContents);
-#endif
 
     // Information icon
     ui.localHighlightsIcon->setPixmap(icon::get("dialog-information").pixmap(16));
 
     // Information icon
     ui.localHighlightsIcon->setPixmap(icon::get("dialog-information").pixmap(16));
index 684dc61..3a2534b 100644 (file)
 #include <QDragEnterEvent>
 #include <QDropEvent>
 #include <QFileDialog>
 #include <QDragEnterEvent>
 #include <QDropEvent>
 #include <QFileDialog>
+#include <QMessageBox>
 #include <QMimeData>
 #include <QUrl>
 #include <QMimeData>
 #include <QUrl>
-#include <QMessageBox>
-
-#if QT_VERSION < 0x050000
-#  include <QDesktopServices>
-#else
-#  include <QStandardPaths>
-#endif
+#include <QStandardPaths>
 
 #include "client.h"
 #include "icon.h"
 
 #include "client.h"
 #include "icon.h"
@@ -115,11 +110,7 @@ IdentityEditWidget::IdentityEditWidget(QWidget *parent)
         addRow("AP", tr("AM/PM"), true);
         addRow("dd", tr("day"), true);
         addRow("MM", tr("month"), true);
         addRow("AP", tr("AM/PM"), true);
         addRow("dd", tr("day"), true);
         addRow("MM", tr("month"), true);
-#if QT_VERSION > 0x050000
-        // Alas, this was only added in Qt 5.  We don't know what version the core has, just hope
-        // for the best (Qt 4 will soon be dropped).
         addRow("t", tr("current timezone"), true);
         addRow("t", tr("current timezone"), true);
-#endif
         formatTooltip << "</table>";
         formatTooltip << "<p>" << tr("Example: Away since %%hh:mm%% on %%dd.MM%%.") << "</p>";
         formatTooltip << "<p>" << tr("%%%% without anything inside represents %%.  Other format "
         formatTooltip << "</table>";
         formatTooltip << "<p>" << tr("Example: Away since %%hh:mm%% on %%dd.MM%%.") << "</p>";
         formatTooltip << "<p>" << tr("%%%% without anything inside represents %%.  Other format "
@@ -370,12 +361,7 @@ void IdentityEditWidget::on_clearOrLoadKeyButton_clicked()
     QSslKey key;
 
     if (ui.keyTypeLabel->property("sslKey").toByteArray().isEmpty())
     QSslKey key;
 
     if (ui.keyTypeLabel->property("sslKey").toByteArray().isEmpty())
-        key = keyByFilename(QFileDialog::getOpenFileName(this, tr("Load a Key"),
-#if QT_VERSION < 0x050000
-                                                         QDesktopServices::storageLocation(QDesktopServices::HomeLocation)));
-#else
-                                                         QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
-#endif
+        key = keyByFilename(QFileDialog::getOpenFileName(this, tr("Load a Key"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
 
     showKeyState(key);
     emit widgetHasChanged();
 
     showKeyState(key);
     emit widgetHasChanged();
@@ -392,16 +378,8 @@ QSslKey IdentityEditWidget::keyByFilename(const QString &filename)
     keyFile.close();
 
     for (int i = 0; i < 2; i++) {
     keyFile.close();
 
     for (int i = 0; i < 2; i++) {
-#if QT_VERSION >= 0x050500
         // On Qt5.5+, support QSsl::KeyAlgorithm::Rsa (1), QSsl::KeyAlgorithm::Dsa (2), and QSsl::KeyAlgorithm::Ec (3)
         for (int j = 1; j < 4; j++) {
         // On Qt5.5+, support QSsl::KeyAlgorithm::Rsa (1), QSsl::KeyAlgorithm::Dsa (2), and QSsl::KeyAlgorithm::Ec (3)
         for (int j = 1; j < 4; j++) {
-#elif QT_VERSION >= 0x050000
-        // On Qt5.0-Qt5.4, support QSsl::KeyAlgorithm::Rsa (1) and QSsl::KeyAlgorithm::Dsa (2) (Ec wasn't added until 5.5)
-        for (int j = 1; j < 3; j++) {
-#else
-        // On Qt4, support QSsl::KeyAlgorithm::Rsa (0) and QSsl::KeyAlgorithm::Dsa (1) (Qt4 uses different indices for the values)
-        for (int j = 0; j < 2; j++) {
-#endif
             key = QSslKey(keyRaw, (QSsl::KeyAlgorithm)j, (QSsl::EncodingFormat)i);
             if (!key.isNull())
                 goto returnKey;
             key = QSslKey(keyRaw, (QSsl::KeyAlgorithm)j, (QSsl::EncodingFormat)i);
             if (!key.isNull())
                 goto returnKey;
@@ -409,12 +387,10 @@ QSslKey IdentityEditWidget::keyByFilename(const QString &filename)
     }
     QMessageBox::information(this, tr("Failed to read key"), tr("Failed to read the key file. It is either incompatible or invalid. Note that the key file must not have a passphrase."));
 returnKey:
     }
     QMessageBox::information(this, tr("Failed to read key"), tr("Failed to read the key file. It is either incompatible or invalid. Note that the key file must not have a passphrase."));
 returnKey:
-#if QT_VERSION >= 0x050500
     if(!key.isNull() && key.algorithm() == QSsl::KeyAlgorithm::Ec && !Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys)) {
         QMessageBox::information(this, tr("Core does not support ECDSA keys"), tr("You loaded an ECDSA key, but the core does not support ECDSA keys. Please contact the core administrator."));
         key.clear();
     }
     if(!key.isNull() && key.algorithm() == QSsl::KeyAlgorithm::Ec && !Client::isCoreFeatureEnabled(Quassel::Feature::EcdsaCertfpKeys)) {
         QMessageBox::information(this, tr("Core does not support ECDSA keys"), tr("You loaded an ECDSA key, but the core does not support ECDSA keys. Please contact the core administrator."));
         key.clear();
     }
-#endif
     return key;
 }
 
     return key;
 }
 
@@ -430,11 +406,9 @@ void IdentityEditWidget::showKeyState(const QSslKey &key)
         case QSsl::Rsa:
             ui.keyTypeLabel->setText(tr("RSA"));
             break;
         case QSsl::Rsa:
             ui.keyTypeLabel->setText(tr("RSA"));
             break;
-#if QT_VERSION >= 0x050500
         case QSsl::Ec:
             ui.keyTypeLabel->setText(tr("ECDSA"));
             break;
         case QSsl::Ec:
             ui.keyTypeLabel->setText(tr("ECDSA"));
             break;
-#endif
         case QSsl::Dsa:
             ui.keyTypeLabel->setText(tr("DSA"));
             break;
         case QSsl::Dsa:
             ui.keyTypeLabel->setText(tr("DSA"));
             break;
@@ -453,12 +427,7 @@ void IdentityEditWidget::on_clearOrLoadCertButton_clicked()
     QSslCertificate cert;
 
     if (ui.certOrgLabel->property("sslCert").toByteArray().isEmpty())
     QSslCertificate cert;
 
     if (ui.certOrgLabel->property("sslCert").toByteArray().isEmpty())
-        cert = certByFilename(QFileDialog::getOpenFileName(this, tr("Load a Certificate"),
-#if QT_VERSION < 0x050000
-                                                           QDesktopServices::storageLocation(QDesktopServices::HomeLocation)));
-#else
-                                                           QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
-#endif
+        cert = certByFilename(QFileDialog::getOpenFileName(this, tr("Load a Certificate"), QStandardPaths::writableLocation(QStandardPaths::HomeLocation)));
     showCertState(cert);
     emit widgetHasChanged();
 }
     showCertState(cert);
     emit widgetHasChanged();
 }
@@ -489,13 +458,8 @@ void IdentityEditWidget::showCertState(const QSslCertificate &cert)
         ui.clearOrLoadCertButton->setText(tr("Load"));
     }
     else {
         ui.clearOrLoadCertButton->setText(tr("Load"));
     }
     else {
-#if QT_VERSION < 0x050000
-        ui.certOrgLabel->setText(cert.subjectInfo(QSslCertificate::Organization));
-        ui.certCNameLabel->setText(cert.subjectInfo(QSslCertificate::CommonName));
-#else
         ui.certOrgLabel->setText(cert.subjectInfo(QSslCertificate::Organization).join(", "));
         ui.certCNameLabel->setText(cert.subjectInfo(QSslCertificate::CommonName).join(", "));
         ui.certOrgLabel->setText(cert.subjectInfo(QSslCertificate::Organization).join(", "));
         ui.certCNameLabel->setText(cert.subjectInfo(QSslCertificate::CommonName).join(", "));
-#endif
         ui.clearOrLoadCertButton->setText(tr("Clear"));
     }
     ui.certOrgLabel->setProperty("sslCert", cert.toPem());
         ui.clearOrLoadCertButton->setText(tr("Clear"));
     }
     ui.certOrgLabel->setProperty("sslCert", cert.toPem());
index 584303e..a549d8f 100644 (file)
@@ -80,32 +80,18 @@ void SslInfoDlg::setCurrentCert(int index)
     ui.validity->setText(tr("%1 to %2").arg(cert.effectiveDate().date().toString(Qt::ISODate), cert.expiryDate().date().toString(Qt::ISODate)));
     ui.md5Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Md5)));
     ui.sha1Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Sha1)));
     ui.validity->setText(tr("%1 to %2").arg(cert.effectiveDate().date().toString(Qt::ISODate), cert.expiryDate().date().toString(Qt::ISODate)));
     ui.md5Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Md5)));
     ui.sha1Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Sha1)));
-#if QT_VERSION < 0x050000
-    // Qt 4 doesn't include SHA-2 hashes, so hide the row
-    ui.sha256Label->hide();
-    ui.sha256Digest->hide();
-#else
     ui.sha256Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Sha256)));
     ui.sha256Digest->setText(prettyDigest(cert.digest(QCryptographicHash::Sha256)));
-#endif
 }
 
 // in Qt5, subjectInfo returns a QStringList(); turn this into a comma-separated string instead
 QString SslInfoDlg::subjectInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const
 {
 }
 
 // in Qt5, subjectInfo returns a QStringList(); turn this into a comma-separated string instead
 QString SslInfoDlg::subjectInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const
 {
-#if QT_VERSION < 0x050000
-    return cert.subjectInfo(subjectInfo);
-#else
     return cert.subjectInfo(subjectInfo).join(", ");
     return cert.subjectInfo(subjectInfo).join(", ");
-#endif
 }
 
 
 // same here
 QString SslInfoDlg::issuerInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const
 {
 }
 
 
 // same here
 QString SslInfoDlg::issuerInfo(const QSslCertificate &cert, QSslCertificate::SubjectInfo subjectInfo) const
 {
-#if QT_VERSION < 0x050000
-    return cert.issuerInfo(subjectInfo);
-#else
     return cert.issuerInfo(subjectInfo).join(", ");
     return cert.issuerInfo(subjectInfo).join(", ");
-#endif
 }
 }
index 59a129e..f3b362e 100644 (file)
@@ -72,9 +72,7 @@ protected:
 
 StatusNotifierItem::StatusNotifierItem(QWidget *parent)
     : StatusNotifierItemParent(parent)
 
 StatusNotifierItem::StatusNotifierItem(QWidget *parent)
     : StatusNotifierItemParent(parent)
-#if QT_VERSION >= 0x050000
     , _iconThemeDir{QDir::tempPath() + QLatin1String{"/quassel-sni-XXXXXX"}}
     , _iconThemeDir{QDir::tempPath() + QLatin1String{"/quassel-sni-XXXXXX"}}
-#endif
 {
     static bool registered = []() -> bool {
         qDBusRegisterMetaType<DBusImageStruct>();
 {
     static bool registered = []() -> bool {
         qDBusRegisterMetaType<DBusImageStruct>();
@@ -93,15 +91,12 @@ StatusNotifierItem::StatusNotifierItem(QWidget *parent)
     trayMenu()->installEventFilter(this);
 
     // Create a temporary directory that holds copies of the tray icons. That way, visualizers can find our icons.
     trayMenu()->installEventFilter(this);
 
     // Create a temporary directory that holds copies of the tray icons. That way, visualizers can find our icons.
-    // For Qt4 the relevant icons are installed in hicolor already, so nothing to be done.
-#if QT_VERSION >= 0x050000
     if (_iconThemeDir.isValid()) {
         _iconThemePath = _iconThemeDir.path();
     }
     else {
         qWarning() << "Could not create temporary directory for themed tray icons!";
     }
     if (_iconThemeDir.isValid()) {
         _iconThemePath = _iconThemeDir.path();
     }
     else {
         qWarning() << "Could not create temporary directory for themed tray icons!";
     }
-#endif
 
     connect(this, SIGNAL(iconsChanged()), this, SLOT(refreshIcons()));
     refreshIcons();
 
     connect(this, SIGNAL(iconsChanged()), this, SLOT(refreshIcons()));
     refreshIcons();
@@ -195,7 +190,6 @@ void StatusNotifierItem::onDBusError(const QDBusError &error)
 
 void StatusNotifierItem::refreshIcons()
 {
 
 void StatusNotifierItem::refreshIcons()
 {
-#if QT_VERSION >= 0x050000
     if (!_iconThemePath.isEmpty()) {
         QDir baseDir{_iconThemePath + "/hicolor"};
         baseDir.removeRecursively();
     if (!_iconThemePath.isEmpty()) {
         QDir baseDir{_iconThemePath + "/hicolor"};
         baseDir.removeRecursively();
@@ -223,7 +217,7 @@ void StatusNotifierItem::refreshIcons()
             }
         }
     }
             }
         }
     }
-#endif
+
     if (_statusNotifierItemDBus) {
         emit _statusNotifierItemDBus->NewIcon();
         emit _statusNotifierItemDBus->NewAttentionIcon();
     if (_statusNotifierItemDBus) {
         emit _statusNotifierItemDBus->NewIcon();
         emit _statusNotifierItemDBus->NewAttentionIcon();
@@ -321,18 +315,9 @@ void StatusNotifierItem::activated(const QPoint &pos)
 bool StatusNotifierItem::eventFilter(QObject *watched, QEvent *event)
 {
     if (mode() == StatusNotifier) {
 bool StatusNotifierItem::eventFilter(QObject *watched, QEvent *event)
 {
     if (mode() == StatusNotifier) {
-        //FIXME: ugly ugly workaround to weird QMenu's focus problems
-#ifdef HAVE_KDE4
-        if (watched == trayMenu() &&
-            (event->type() == QEvent::WindowDeactivate || (event->type() == QEvent::MouseButtonRelease && static_cast<QMouseEvent *>(event)->button() == Qt::LeftButton))) {
-            // put at the back of event queue to let the action activate anyways
-            QTimer::singleShot(0, trayMenu(), SLOT(hide()));
-        }
-#else
         if (watched == trayMenu() && event->type() == QEvent::HoverLeave) {
             trayMenu()->hide();
         }
         if (watched == trayMenu() && event->type() == QEvent::HoverLeave) {
             trayMenu()->hide();
         }
-#endif
     }
     return StatusNotifierItemParent::eventFilter(watched, event);
 }
     }
     return StatusNotifierItemParent::eventFilter(watched, event);
 }
@@ -342,12 +327,9 @@ void StatusNotifierItem::showMessage(const QString &title, const QString &messag
 {
     QString message = message_;
     if (_notificationsClient->isValid()) {
 {
     QString message = message_;
     if (_notificationsClient->isValid()) {
-        if (_notificationsClientSupportsMarkup)
-#if QT_VERSION < 0x050000
-            message = Qt::escape(message);
-#else
+        if (_notificationsClientSupportsMarkup) {
             message = message.toHtmlEscaped();
             message = message.toHtmlEscaped();
-#endif
+        }
 
         QStringList actions;
         if (_notificationsClientSupportsActions)
 
         QStringList actions;
         if (_notificationsClientSupportsActions)
index 8e40be3..5a103b6 100644 (file)
 #include <QDBusError>
 #include <QHash>
 #include <QString>
 #include <QDBusError>
 #include <QHash>
 #include <QString>
-
-#if QT_VERSION >= 0x050000
-#  include <QTemporaryDir>
-#endif
+#include <QTemporaryDir>
 
 #include "notificationsclient.h"
 #include "systemtray.h"
 
 #include "notificationsclient.h"
 #include "systemtray.h"
@@ -101,9 +98,7 @@ private:
     QString _iconThemePath;
     QString _menuObjectPath;
 
     QString _iconThemePath;
     QString _menuObjectPath;
 
-#if QT_VERSION >= 0x050000
     QTemporaryDir _iconThemeDir;
     QTemporaryDir _iconThemeDir;
-#endif
 
     friend class StatusNotifierItemDBus;
 };
 
     friend class StatusNotifierItemDBus;
 };
index ee21928..e13af94 100644 (file)
 #include "statusnotifieritemdbus.h"
 #include "statusnotifieritem.h"
 
 #include "statusnotifieritemdbus.h"
 #include "statusnotifieritem.h"
 
+#include <QApplication>
 #include <QDBusConnection>
 #include <QDBusConnection>
-#include <QPixmap>
 #include <QImage>
 #include <QImage>
-#include <QApplication>
 #include <QMenu>
 #include <QMenu>
-#include <QMovie>
-
-#ifdef HAVE_KDE4
-#  include <KWindowInfo>
-#  include <KWindowSystem>
-#endif
+#include <QPixmap>
 
 #include "statusnotifierwatcher.h"
 #include "statusnotifieritemadaptor.h"
 
 #include "statusnotifierwatcher.h"
 #include "statusnotifieritemadaptor.h"
@@ -45,7 +39,6 @@ __inline int toInt(WId wid)
     return (int)((__int64)wid);
 }
 
     return (int)((__int64)wid);
 }
 
-
 #else
 __inline int toInt(WId wid)
 {
 #else
 __inline int toInt(WId wid)
 {
@@ -320,15 +313,7 @@ void StatusNotifierItemDBus::ContextMenu(int x, int y)
 
     //TODO: nicer placement, possible?
     if (!m_statusNotifierItem->trayMenu()->isVisible()) {
 
     //TODO: nicer placement, possible?
     if (!m_statusNotifierItem->trayMenu()->isVisible()) {
-#ifdef HAVE_KDE4
-        m_statusNotifierItem->trayMenu()->setWindowFlags(Qt::Window|Qt::FramelessWindowHint);
-#endif
         m_statusNotifierItem->trayMenu()->popup(QPoint(x, y));
         m_statusNotifierItem->trayMenu()->popup(QPoint(x, y));
-#ifdef HAVE_KDE4
-        KWindowSystem::setState(m_statusNotifierItem->trayMenu()->winId(), NET::SkipTaskbar|NET::SkipPager|NET::KeepAbove);
-        KWindowSystem::setType(m_statusNotifierItem->trayMenu()->winId(), NET::PopupMenu);
-        KWindowSystem::forceActiveWindow(m_statusNotifierItem->trayMenu()->winId());
-#endif
     }
     else {
         m_statusNotifierItem->trayMenu()->hide();
     }
     else {
         m_statusNotifierItem->trayMenu()->hide();
index 7e38a6a..d4e1766 100644 (file)
 #include <QApplication>
 #include <QMenu>
 
 #include <QApplication>
 #include <QMenu>
 
-#ifdef HAVE_KDE4
-#  include <KMenu>
-#  include <KWindowInfo>
-#  include <KWindowSystem>
-#endif
-
 #include "action.h"
 #include "actioncollection.h"
 #include "client.h"
 #include "action.h"
 #include "actioncollection.h"
 #include "client.h"
@@ -48,19 +42,9 @@ SystemTray::SystemTray(QWidget *parent)
     ActionCollection *coll = QtUi::actionCollection("General");
     _minimizeRestoreAction = new Action(tr("&Minimize"), this, this, SLOT(minimizeRestore()));
 
     ActionCollection *coll = QtUi::actionCollection("General");
     _minimizeRestoreAction = new Action(tr("&Minimize"), this, this, SLOT(minimizeRestore()));
 
-#ifdef HAVE_KDE4
-    KMenu *kmenu;
-    _trayMenu = kmenu = new KMenu();
-    kmenu->addTitle(icon::get(iconName(State::Active)), "Quassel IRC");
-#else
     _trayMenu = new QMenu(associatedWidget());
     _trayMenu = new QMenu(associatedWidget());
-#endif
-
     _trayMenu->setTitle("Quassel IRC");
     _trayMenu->setTitle("Quassel IRC");
-
-#ifndef HAVE_KDE4
     _trayMenu->setAttribute(Qt::WA_Hover);
     _trayMenu->setAttribute(Qt::WA_Hover);
-#endif
 
     _trayMenu->addAction(coll->action("ConnectCore"));
     _trayMenu->addAction(coll->action("DisconnectCore"));
 
     _trayMenu->addAction(coll->action("ConnectCore"));
     _trayMenu->addAction(coll->action("DisconnectCore"));
@@ -121,16 +105,6 @@ void SystemTray::setMode(Mode mode)
 {
     if (mode != _mode) {
         _mode = mode;
 {
     if (mode != _mode) {
         _mode = mode;
-#ifdef HAVE_KDE4
-        if (_trayMenu) {
-            if (mode == Mode::Legacy) {
-                _trayMenu->setWindowFlags(Qt::Popup);
-            }
-            else {
-                _trayMenu->setWindowFlags(Qt::Window);
-            }
-        }
-#endif
         emit modeChanged(mode);
     }
 }
         emit modeChanged(mode);
     }
 }
index 9e6435d..c083193 100644 (file)
@@ -114,19 +114,11 @@ void TopicWidget::setTopic(const QModelIndex &index)
         switch (Client::networkModel()->bufferType(id)) {
         case BufferInfo::StatusBuffer:
             if (network) {
         switch (Client::networkModel()->bufferType(id)) {
         case BufferInfo::StatusBuffer:
             if (network) {
-#if QT_VERSION < 0x050000
-                newtopic = QString("%1 (%2) | %3 | %4")
-                           .arg(Qt::escape(network->networkName()))
-                           .arg(Qt::escape(network->currentServer()))
-                           .arg(tr("Users: %1").arg(network->ircUsers().count()))
-                           .arg(tr("Lag: %1 msecs").arg(network->latency()));
-#else
                 newtopic = QString("%1 (%2) | %3 | %4")
                            .arg(network->networkName().toHtmlEscaped())
                            .arg(network->currentServer().toHtmlEscaped())
                            .arg(tr("Users: %1").arg(network->ircUsers().count()))
                            .arg(tr("Lag: %1 msecs").arg(network->latency()));
                 newtopic = QString("%1 (%2) | %3 | %4")
                            .arg(network->networkName().toHtmlEscaped())
                            .arg(network->currentServer().toHtmlEscaped())
                            .arg(tr("Users: %1").arg(network->ircUsers().count()))
                            .arg(tr("Lag: %1 msecs").arg(network->latency()));
-#endif
             }
             else {
                 newtopic = index0.data(Qt::DisplayRole).toString();
             }
             else {
                 newtopic = index0.data(Qt::DisplayRole).toString();
@@ -280,9 +272,7 @@ QString TopicWidget::sanitizeTopic(const QString& topic)
     // some unicode characters with a new line, which then triggers
     // a stack overflow later
     QString result(topic);
     // some unicode characters with a new line, which then triggers
     // a stack overflow later
     QString result(topic);
-#if QT_VERSION >= 0x050000
     result.replace(QChar::CarriageReturn, " ");
     result.replace(QChar::CarriageReturn, " ");
-#endif
     result.replace(QChar::ParagraphSeparator, " ");
     result.replace(QChar::LineSeparator, " ");
 
     result.replace(QChar::ParagraphSeparator, " ");
     result.replace(QChar::LineSeparator, " ");
 
index 1807631..5542739 100644 (file)
 #include <QApplication>
 
 Action::Action(QObject *parent)
 #include <QApplication>
 
 Action::Action(QObject *parent)
-#ifdef HAVE_KDE4
-    : KAction(parent)
-#else
     : QWidgetAction(parent)
     : QWidgetAction(parent)
-#endif
 {
     init();
 }
 
 
 Action::Action(const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
 {
     init();
 }
 
 
 Action::Action(const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
-#ifdef HAVE_KDE4
-    : KAction(parent)
-#else
     : QWidgetAction(parent)
     : QWidgetAction(parent)
-#endif
 {
     init();
     setText(text);
 {
     init();
     setText(text);
@@ -51,11 +43,7 @@ Action::Action(const QString &text, QObject *parent, const QObject *receiver, co
 
 
 Action::Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
 
 
 Action::Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver, const char *slot, const QKeySequence &shortcut)
-#ifdef HAVE_KDE4
-    : KAction(parent)
-#else
     : QWidgetAction(parent)
     : QWidgetAction(parent)
-#endif
 {
     init();
     setIcon(icon);
 {
     init();
     setIcon(icon);
@@ -66,9 +54,6 @@ Action::Action(const QIcon &icon, const QString &text, QObject *parent, const QO
 }
 
 
 }
 
 
-#ifdef HAVE_KDE4
-void Action::init() {}
-#else
 void Action::init()
 {
     connect(this, SIGNAL(triggered(bool)), this, SLOT(slotTriggered()));
 void Action::init()
 {
     connect(this, SIGNAL(triggered(bool)), this, SLOT(slotTriggered()));
@@ -99,12 +84,8 @@ QKeySequence Action::shortcut(ShortcutTypes type) const
 {
     Q_ASSERT(type);
     if (type == DefaultShortcut) {
 {
     Q_ASSERT(type);
     if (type == DefaultShortcut) {
-#if QT_VERSION < 0x050000
-        return property("defaultShortcut").value<QKeySequence>();
-#else
         auto sequence = property("defaultShortcuts").value<QList<QKeySequence>>();
         return sequence.isEmpty() ? QKeySequence() : sequence.first();
         auto sequence = property("defaultShortcuts").value<QList<QKeySequence>>();
         return sequence.isEmpty() ? QKeySequence() : sequence.first();
-#endif
     }
 
     return shortcuts().isEmpty() ? QKeySequence() : shortcuts().first();
     }
 
     return shortcuts().isEmpty() ? QKeySequence() : shortcuts().first();
@@ -122,15 +103,8 @@ void Action::setShortcut(const QKeySequence &key, ShortcutTypes type)
     Q_ASSERT(type);
 
     if (type & DefaultShortcut) {
     Q_ASSERT(type);
 
     if (type & DefaultShortcut) {
-#if QT_VERSION < 0x050000
-        setProperty("defaultShortcut", key);
-#else
         setProperty("defaultShortcuts", QVariant::fromValue(QList<QKeySequence>() << key));
         setProperty("defaultShortcuts", QVariant::fromValue(QList<QKeySequence>() << key));
-#endif
     }
     if (type & ActiveShortcut)
         QAction::setShortcut(key);
 }
     }
     if (type & ActiveShortcut)
         QAction::setShortcut(key);
 }
-
-
-#endif /* HAVE_KDE4 */
index fb0a7e1..62bc8a3 100644 (file)
  * Parts of this API have been shamelessly stolen from KDE's kaction.h     *
  ***************************************************************************/
 
  * Parts of this API have been shamelessly stolen from KDE's kaction.h     *
  ***************************************************************************/
 
-#ifndef ACTION_H_
-#define ACTION_H_
-
-#ifndef HAVE_KDE4
+#pragma once
 
 #include <QShortcut>
 #include <QWidgetAction>
 
 #include <QShortcut>
 #include <QWidgetAction>
@@ -70,24 +67,3 @@ private slots:
 
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(Action::ShortcutTypes)
 
 
 Q_DECLARE_OPERATORS_FOR_FLAGS(Action::ShortcutTypes)
-
-#else /* HAVE_KDE4 */
-#include <KAction>
-
-class Action : public KAction
-{
-    Q_OBJECT
-
-public:
-    explicit Action(QObject *parent);
-    Action(const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0);
-    Action(const QIcon &icon, const QString &text, QObject *parent, const QObject *receiver = 0, const char *slot = 0, const QKeySequence &shortcut = 0);
-
-private:
-    void init();
-};
-
-
-#endif
-
-#endif
index 3d5fcf8..8928053 100644 (file)
@@ -203,31 +203,19 @@ void ActionCollection::actionDestroyed(QObject *obj)
     unlistAction(action);
 }
 
     unlistAction(action);
 }
 
-#if QT_VERSION >= 0x050000
 void ActionCollection::connectNotify(const QMetaMethod &signal)
 void ActionCollection::connectNotify(const QMetaMethod &signal)
-#else
-void ActionCollection::connectNotify(const char *signal)
-#endif
 {
     if (_connectHovered && _connectTriggered)
         return;
 
 {
     if (_connectHovered && _connectTriggered)
         return;
 
-#if QT_VERSION >= 0x050000
     if (QMetaMethod::fromSignal(&ActionCollection::actionHovered) == signal) {
     if (QMetaMethod::fromSignal(&ActionCollection::actionHovered) == signal) {
-#else
-    if (QMetaObject::normalizedSignature(SIGNAL(actionHovered(QAction *))) == signal) {
-#endif
         if (!_connectHovered) {
             _connectHovered = true;
             foreach(QAction* action, actions())
             connect(action, SIGNAL(hovered()), SLOT(slotActionHovered()));
         }
     }
         if (!_connectHovered) {
             _connectHovered = true;
             foreach(QAction* action, actions())
             connect(action, SIGNAL(hovered()), SLOT(slotActionHovered()));
         }
     }
-#if QT_VERSION >= 0x050000
     else if (QMetaMethod::fromSignal(&ActionCollection::actionTriggered) == signal) {
     else if (QMetaMethod::fromSignal(&ActionCollection::actionTriggered) == signal) {
-#else
-    else if (QMetaObject::normalizedSignature(SIGNAL(actionTriggered(QAction *))) == signal) {
-#endif
         if (!_connectTriggered) {
             _connectTriggered = true;
             foreach(QAction* action, actions())
         if (!_connectTriggered) {
             _connectTriggered = true;
             foreach(QAction* action, actions())
index f7f5ff8..5de038f 100644 (file)
@@ -95,11 +95,7 @@ signals:
     void actionTriggered(QAction *action);
 
 protected slots:
     void actionTriggered(QAction *action);
 
 protected slots:
-#if QT_VERSION >= 0x050000
     virtual void connectNotify(const QMetaMethod &signal);
     virtual void connectNotify(const QMetaMethod &signal);
-#else
-    virtual void connectNotify(const char *signal);
-#endif
     virtual void slotActionTriggered();
 
 private slots:
     virtual void slotActionTriggered();
 
 private slots:
@@ -123,11 +119,7 @@ int ActionCollection::count() const { return actions().count(); }
 bool ActionCollection::isEmpty() const { return actions().count(); }
 
 #else /* HAVE_KDE */
 bool ActionCollection::isEmpty() const { return actions().count(); }
 
 #else /* HAVE_KDE */
-#  ifdef HAVE_KDE4
-#    include <KActionCollection>
-#  else
-#    include <KXmlGui/KActionCollection>
-#  endif
+#  include <KXmlGui/KActionCollection>
 
 class ActionCollection : public KActionCollection
 {
 
 class ActionCollection : public KActionCollection
 {
index 9bf7a52..969107c 100644 (file)
@@ -75,9 +75,7 @@ void BufferView::init()
 
     setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 
 
     setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
 
-    // breaks with Qt 4.8
-    if (QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10!
-        setAnimated(true);
+    setAnimated(true);
 
     // FIXME This is to workaround bug #663
     setUniformRowHeights(true);
 
     // FIXME This is to workaround bug #663
     setUniformRowHeights(true);
@@ -394,15 +392,9 @@ void BufferView::setExpandedState(const QModelIndex &networkIdx)
     storeExpandedState(networkIdx); // this call is needed to keep track of the isActive state
 }
 
     storeExpandedState(networkIdx); // this call is needed to keep track of the isActive state
 }
 
-#if QT_VERSION < 0x050000
-void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
-{
-    TreeViewTouch::dataChanged(topLeft, bottomRight);
-#else
 void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
 {
     TreeViewTouch::dataChanged(topLeft, bottomRight, roles);
 void BufferView::dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles)
 {
     TreeViewTouch::dataChanged(topLeft, bottomRight, roles);
-#endif
 
     // determine how many items have been changed and if any of them is a networkitem
     // which just swichted from active to inactive or vice versa
 
     // determine how many items have been changed and if any of them is a networkitem
     // which just swichted from active to inactive or vice versa
@@ -716,11 +708,7 @@ bool BufferViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, c
     if (!value.isValid())
         return QStyledItemDelegate::editorEvent(event, model, option, index);
 
     if (!value.isValid())
         return QStyledItemDelegate::editorEvent(event, model, option, index);
 
-#if QT_VERSION < 0x050000
-    QStyleOptionViewItemV4 viewOpt(option);
-#else
     QStyleOptionViewItem viewOpt(option);
     QStyleOptionViewItem viewOpt(option);
-#endif
     initStyleOption(&viewOpt, index);
 
     QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget);
     initStyleOption(&viewOpt, index);
 
     QRect checkRect = viewOpt.widget->style()->subElementRect(QStyle::SE_ItemViewItemCheckIndicator, &viewOpt, viewOpt.widget);
index 2a32eb2..47a519f 100644 (file)
@@ -85,11 +85,7 @@ protected:
     virtual void focusInEvent(QFocusEvent *event) { QAbstractScrollArea::focusInEvent(event); }
     virtual void contextMenuEvent(QContextMenuEvent *event);
 
     virtual void focusInEvent(QFocusEvent *event) { QAbstractScrollArea::focusInEvent(event); }
     virtual void contextMenuEvent(QContextMenuEvent *event);
 
-#if QT_VERSION < 0x050000
-    virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
-#else
     virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
     virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
-#endif
 
 private slots:
     void joinChannel(const QModelIndex &index);
 
 private slots:
     void joinChannel(const QModelIndex &index);
index 8dad568..22e0383 100644 (file)
 
 #include "colorbutton.h"
 
 
 #include "colorbutton.h"
 
+#include <QColorDialog>
 #include <QPainter>
 #include <QStyle>
 #include <QStyleOptionFrame>
 
 #include <QPainter>
 #include <QStyle>
 #include <QStyleOptionFrame>
 
-#ifdef HAVE_KDE4
-#  include <KColorDialog>
-#else
-#  include <QColorDialog>
-#endif
 
 ColorButton::ColorButton(QWidget *parent) : QToolButton(parent)
 {
 
 ColorButton::ColorButton(QWidget *parent) : QToolButton(parent)
 {
@@ -56,13 +52,7 @@ QColor ColorButton::color() const
 
 void ColorButton::chooseColor()
 {
 
 void ColorButton::chooseColor()
 {
-#ifdef HAVE_KDE4
-    QColor c = color();
-    KColorDialog::getColor(c, this);
-#else
     QColor c = QColorDialog::getColor(color(), this);
     QColor c = QColorDialog::getColor(color(), this);
-#endif
-
     if (c.isValid()) {
         setColor(c);
     }
     if (c.isValid()) {
         setColor(c);
     }
index 3f65505..ffd4e3d 100644 (file)
 #ifdef Q_WS_X11
 #  include <QX11Info>
 #endif
 #ifdef Q_WS_X11
 #  include <QX11Info>
 #endif
-#ifdef HAVE_KDE4
-#  include <KWindowInfo>
-#  include <KWindowSystem>
-#endif
 
 QWidget *GraphicalUi::_mainWidget = 0;
 QHash<QString, ActionCollection *> GraphicalUi::_actionCollections;
 ContextMenuActionProvider *GraphicalUi::_contextMenuActionProvider = 0;
 ToolBarActionProvider *GraphicalUi::_toolBarActionProvider = 0;
 UiStyle *GraphicalUi::_uiStyle = 0;
 
 QWidget *GraphicalUi::_mainWidget = 0;
 QHash<QString, ActionCollection *> GraphicalUi::_actionCollections;
 ContextMenuActionProvider *GraphicalUi::_contextMenuActionProvider = 0;
 ToolBarActionProvider *GraphicalUi::_toolBarActionProvider = 0;
 UiStyle *GraphicalUi::_uiStyle = 0;
-bool GraphicalUi::_onAllDesktops = false;
 
 
 GraphicalUi::GraphicalUi(QObject *parent) : AbstractUi(parent), Singleton<GraphicalUi>(this)
 
 
 GraphicalUi::GraphicalUi(QObject *parent) : AbstractUi(parent), Singleton<GraphicalUi>(this)
@@ -169,65 +164,6 @@ bool GraphicalUi::checkMainWidgetVisibility(bool perform)
         return true;
     }
 
         return true;
     }
 
-#elif defined(HAVE_KDE4) && defined(Q_WS_X11)
-    KWindowInfo info1 = KWindowSystem::windowInfo(mainWidget()->winId(), NET::XAWMState | NET::WMState | NET::WMDesktop);
-    // mapped = visible (but possibly obscured)
-    bool mapped = (info1.mappingState() == NET::Visible) && !info1.isMinimized();
-
-    //    - not mapped -> show, raise, focus
-    //    - mapped
-    //        - obscured -> raise, focus
-    //        - not obscured -> hide
-    //info1.mappingState() != NET::Visible -> window on another desktop?
-    if (!mapped) {
-        if (perform)
-            minimizeRestore(true);
-        return true;
-    }
-    else {
-        QListIterator<WId> it(KWindowSystem::stackingOrder());
-        it.toBack();
-        while (it.hasPrevious()) {
-            WId id = it.previous();
-            if (id == mainWidget()->winId())
-                break;
-
-            KWindowInfo info2 = KWindowSystem::windowInfo(id, NET::WMDesktop | NET::WMGeometry | NET::XAWMState | NET::WMState | NET::WMWindowType);
-
-            if (info2.mappingState() != NET::Visible)
-                continue;  // not visible on current desktop -> ignore
-
-            if (!info2.geometry().intersects(mainWidget()->geometry()))
-                continue;  // not obscuring the window -> ignore
-
-            if (!info1.hasState(NET::KeepAbove) && info2.hasState(NET::KeepAbove))
-                continue;  // obscured by window kept above -> ignore
-
-            NET::WindowType type = info2.windowType(NET::NormalMask | NET::DesktopMask
-                | NET::DockMask | NET::ToolbarMask | NET::MenuMask | NET::DialogMask
-                | NET::OverrideMask | NET::TopMenuMask | NET::UtilityMask | NET::SplashMask);
-
-            if (type == NET::Dock || type == NET::TopMenu)
-                continue;  // obscured by dock or topmenu -> ignore
-
-            if (perform) {
-                KWindowSystem::raiseWindow(mainWidget()->winId());
-                KWindowSystem::activateWindow(mainWidget()->winId());
-            }
-            return true;
-        }
-
-        //not on current desktop?
-        if (!info1.isOnCurrentDesktop()) {
-            if (perform)
-                KWindowSystem::activateWindow(mainWidget()->winId());
-            return true;
-        }
-
-        if (perform)
-            minimizeRestore(false);  // hide
-        return false;
-    }
 #else
 
     if (!mainWidget()->isVisible() || mainWidget()->isMinimized() || !mainWidget()->isActiveWindow()) {
 #else
 
     if (!mainWidget()->isVisible() || mainWidget()->isMinimized() || !mainWidget()->isActiveWindow()) {
@@ -264,29 +200,6 @@ void GraphicalUi::minimizeRestore(bool show)
 
 void GraphicalUi::activateMainWidget()
 {
 
 void GraphicalUi::activateMainWidget()
 {
-#ifdef HAVE_KDE4
-#  ifdef Q_WS_X11
-    KWindowInfo info = KWindowSystem::windowInfo(mainWidget()->winId(), NET::WMDesktop | NET::WMFrameExtents);
-    if (_onAllDesktops) {
-        KWindowSystem::setOnAllDesktops(mainWidget()->winId(), true);
-    }
-    else {
-        KWindowSystem::setCurrentDesktop(info.desktop());
-    }
-
-    mainWidget()->move(info.frameGeometry().topLeft()); // avoid placement policies
-    mainWidget()->show();
-    mainWidget()->raise();
-    KWindowSystem::raiseWindow(mainWidget()->winId());
-    KWindowSystem::activateWindow(mainWidget()->winId());
-#  else
-    mainWidget()->show();
-    KWindowSystem::raiseWindow(mainWidget()->winId());
-    KWindowSystem::forceActiveWindow(mainWidget()->winId());
-#  endif
-
-#else /* HAVE_KDE4 */
-
 #ifdef Q_WS_X11
     // Bypass focus stealing prevention
     QX11Info::setAppUserTime(QX11Info::appTime());
 #ifdef Q_WS_X11
     // Bypass focus stealing prevention
     QX11Info::setAppUserTime(QX11Info::appTime());
@@ -306,18 +219,11 @@ void GraphicalUi::activateMainWidget()
     mainWidget()->raise();
     mainWidget()->activateWindow();
 #endif
     mainWidget()->raise();
     mainWidget()->activateWindow();
 #endif
-
-#endif /* HAVE_KDE4 */
 }
 
 
 void GraphicalUi::hideMainWidget()
 {
 }
 
 
 void GraphicalUi::hideMainWidget()
 {
-#if defined(HAVE_KDE4) && defined(Q_WS_X11)
-    KWindowInfo info = KWindowSystem::windowInfo(mainWidget()->winId(), NET::WMDesktop | NET::WMFrameExtents);
-    _onAllDesktops = info.onAllDesktops();
-#endif
-
     if (instance()->isHidingMainWidgetAllowed())
 #ifdef Q_OS_MAC
         ShowHideProcess(&instance()->_procNum, false);
     if (instance()->isHidingMainWidgetAllowed())
 #ifdef Q_OS_MAC
         ShowHideProcess(&instance()->_procNum, false);
index 3797d08..3b94544 100644 (file)
@@ -115,7 +115,6 @@ private:
     static ContextMenuActionProvider *_contextMenuActionProvider;
     static ToolBarActionProvider *_toolBarActionProvider;
     static UiStyle *_uiStyle;
     static ContextMenuActionProvider *_contextMenuActionProvider;
     static ToolBarActionProvider *_toolBarActionProvider;
     static UiStyle *_uiStyle;
-    static bool _onAllDesktops;
 
 #ifdef Q_OS_WIN
     DWORD _dwTickCount;
 
 #ifdef Q_OS_WIN
     DWORD _dwTickCount;
index 133a243..2c9d594 100644 (file)
@@ -87,7 +87,6 @@ MultiLineEdit::~MultiLineEdit()
 {
 }
 
 {
 }
 
-
 #if defined HAVE_SONNET && !defined HAVE_KDE
 Sonnet::Highlighter *MultiLineEdit::highlighter() const
 {
 #if defined HAVE_SONNET && !defined HAVE_KDE
 Sonnet::Highlighter *MultiLineEdit::highlighter() const
 {
@@ -206,11 +205,8 @@ void MultiLineEdit::updateSizeHint()
 
     // use the style to determine a decent size
     int h = qMin(qMax((int)document()->size().height() + scrollBarHeight, minPixelHeight), maxPixelHeight) + 2 * frameWidth();
 
     // use the style to determine a decent size
     int h = qMin(qMax((int)document()->size().height() + scrollBarHeight, minPixelHeight), maxPixelHeight) + 2 * frameWidth();
-#if QT_VERSION < 0x050000
-    QStyleOptionFrameV2 opt;
-#else
+
     QStyleOptionFrame opt;
     QStyleOptionFrame opt;
-#endif
     opt.initFrom(this);
     opt.rect = QRect(0, 0, 100, h);
     opt.lineWidth = lineWidth();
     opt.initFrom(this);
     opt.rect = QRect(0, 0, 100, h);
     opt.lineWidth = lineWidth();
@@ -745,11 +741,7 @@ void MultiLineEdit::on_textChanged()
                 QString msg = tr("Do you really want to paste %n line(s)?", "", lines.count());
                 msg += "<p>";
                 for (int i = 0; i < 4; i++) {
                 QString msg = tr("Do you really want to paste %n line(s)?", "", lines.count());
                 msg += "<p>";
                 for (int i = 0; i < 4; i++) {
-#if QT_VERSION < 0x050000
-                    msg += Qt::escape(lines[i].left(40));
-#else
                     msg += lines[i].left(40).toHtmlEscaped();
                     msg += lines[i].left(40).toHtmlEscaped();
-#endif
                     if (lines[i].count() > 40)
                         msg += "...";
                     msg += "<br />";
                     if (lines[i].count() > 40)
                         msg += "...";
                     msg += "<br />";
index bd59bbc..b4badfb 100644 (file)
 #include <QKeyEvent>
 #include <QHash>
 
 #include <QKeyEvent>
 #include <QHash>
 
-#ifdef HAVE_KDE4
-#  include <KDE/KTextEdit>
-#  define MultiLineEditParent KTextEdit
-#elif defined HAVE_KF5
+#if defined HAVE_KF5
 #  include <KTextWidgets/KTextEdit>
 #  define MultiLineEditParent KTextEdit
 #else
 #  include <KTextWidgets/KTextEdit>
 #  define MultiLineEditParent KTextEdit
 #else
index eb5dd11..2bd783b 100644 (file)
@@ -47,8 +47,6 @@ NickView::NickView(QWidget *parent)
     setContextMenuPolicy(Qt::CustomContextMenu);
     setSelectionMode(QAbstractItemView::ExtendedSelection);
 
     setContextMenuPolicy(Qt::CustomContextMenu);
     setSelectionMode(QAbstractItemView::ExtendedSelection);
 
-//   // breaks with Qt 4.8
-//   if(QString("4.8.0") > qVersion()) // FIXME breaks with Qt versions >= 4.10!
     setAnimated(true);
 
     connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(showContextMenu(const QPoint &)));
     setAnimated(true);
 
     connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(showContextMenu(const QPoint &)));
index d3d7982..6e2361b 100644 (file)
@@ -156,11 +156,7 @@ void StyledLabel::setText(const QString &text)
 void StyledLabel::updateToolTip()
 {
     if (frameRect().width() - 2*frameWidth() < _layout.minimumWidth())
 void StyledLabel::updateToolTip()
 {
     if (frameRect().width() - 2*frameWidth() < _layout.minimumWidth())
-#if QT_VERSION < 0x050000
-        setToolTip(QString("<qt>%1</qt>").arg(Qt::escape(_layout.text())));  // only rich text gets wordwrapped!
-#else
         setToolTip(QString("<qt>%1</qt>").arg(_layout.text().toHtmlEscaped()));  // only rich text gets wordwrapped!
         setToolTip(QString("<qt>%1</qt>").arg(_layout.text().toHtmlEscaped()));  // only rich text gets wordwrapped!
-#endif
     else
         setToolTip(QString());
 }
     else
         setToolTip(QString());
 }
@@ -216,11 +212,7 @@ int StyledLabel::posToCursor(const QPointF &pos)
 void StyledLabel::mouseMoveEvent(QMouseEvent *event)
 {
     if (event->buttons() == Qt::NoButton) {
 void StyledLabel::mouseMoveEvent(QMouseEvent *event)
 {
     if (event->buttons() == Qt::NoButton) {
-#if QT_VERSION < 0x050000
-        Clickable click = _clickables.atCursorPos(posToCursor(event->posF()));
-#else
         Clickable click = _clickables.atCursorPos(posToCursor(event->localPos()));
         Clickable click = _clickables.atCursorPos(posToCursor(event->localPos()));
-#endif
         if (click.isValid())
             setHoverMode(click.start(), click.length());
         else
         if (click.isValid())
             setHoverMode(click.start(), click.length());
         else
@@ -247,11 +239,7 @@ void StyledLabel::leaveEvent(QEvent *)
 void StyledLabel::mousePressEvent(QMouseEvent *event)
 {
     if (event->button() == Qt::LeftButton) {
 void StyledLabel::mousePressEvent(QMouseEvent *event)
 {
     if (event->button() == Qt::LeftButton) {
-#if QT_VERSION < 0x050000
-        Clickable click = _clickables.atCursorPos(posToCursor(event->posF()));
-#else
         Clickable click = _clickables.atCursorPos(posToCursor(event->localPos()));
         Clickable click = _clickables.atCursorPos(posToCursor(event->localPos()));
-#endif
         if (click.isValid())
             emit clickableActivated(click);
     }
         if (click.isValid())
             emit clickableActivated(click);
     }
index 067ac13..74799b3 100644 (file)
@@ -33,11 +33,7 @@ TreeViewTouch::TreeViewTouch(QWidget *parent)
 
 
 bool TreeViewTouch::event(QEvent *event) {
 
 
 bool TreeViewTouch::event(QEvent *event) {
-#if QT_VERSION >= 0x050000
     if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type()==QTouchDevice::TouchScreen) {
     if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->device()->type()==QTouchDevice::TouchScreen) {
-#else
-    if (event->type() == QEvent::TouchBegin && ((QTouchEvent*)event)->deviceType()==QTouchEvent::TouchScreen) {
-#endif
         // Register that we may be scrolling, set the scroll mode to scroll-per-pixel
         // and accept the event (return true) so that we will receive TouchUpdate and TouchEnd/TouchCancel
         _touchScrollInProgress = true;
         // Register that we may be scrolling, set the scroll mode to scroll-per-pixel
         // and accept the event (return true) so that we will receive TouchUpdate and TouchEnd/TouchCancel
         _touchScrollInProgress = true;
@@ -62,11 +58,7 @@ bool TreeViewTouch::event(QEvent *event) {
         return true;
     }
 
         return true;
     }
 
-#if QT_VERSION >= 0x050000
     if (event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel) {
     if (event->type() == QEvent::TouchEnd || event->type() == QEvent::TouchCancel) {
-#else
-    if (event->type() == QEvent::TouchEnd) {
-#endif
         // End scroll and reset variables
         _touchScrollInProgress = false;
         _firstTouchUpdateHappened = false;
         // End scroll and reset variables
         _touchScrollInProgress = false;
         _firstTouchUpdateHappened = false;
index 038dc8a..f7edcbc 100644 (file)
@@ -1150,25 +1150,18 @@ quint8 UiStyle::StyledMessage::senderHash() const
 
 /***********************************************************************************/
 
 
 /***********************************************************************************/
 
-#if QT_VERSION < 0x050000
-uint qHash(UiStyle::ItemFormatType key)
-{
-    return qHash(static_cast<quint32>(key));
-}
-
-#else
-
 uint qHash(UiStyle::ItemFormatType key, uint seed)
 {
     return qHash(static_cast<quint32>(key), seed);
 }
 uint qHash(UiStyle::ItemFormatType key, uint seed)
 {
     return qHash(static_cast<quint32>(key), seed);
 }
-#endif
+
 
 UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs)
 {
     return static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
 }
 
 
 UiStyle::FormatType operator|(UiStyle::FormatType lhs, UiStyle::FormatType rhs)
 {
     return static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
 }
 
+
 UiStyle::FormatType& operator|=(UiStyle::FormatType& lhs, UiStyle::FormatType rhs)
 {
     lhs = static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
 UiStyle::FormatType& operator|=(UiStyle::FormatType& lhs, UiStyle::FormatType rhs)
 {
     lhs = static_cast<UiStyle::FormatType>(static_cast<quint32>(lhs) | static_cast<quint32>(rhs));
index acf6597..661e025 100644 (file)
@@ -166,11 +166,7 @@ public:
     };
 
     /// Display of sender prefix modes
     };
 
     /// Display of sender prefix modes
-#if QT_VERSION >= 0x050000
     enum class SenderPrefixMode {
     enum class SenderPrefixMode {
-#else
-    enum SenderPrefixMode {
-#endif
         NoModes = 0,      ///< Hide sender modes
         HighestMode = 1,  ///< Show the highest active sender mode
         AllModes = 2      ///< Show all active sender modes
         NoModes = 0,      ///< Hide sender modes
         HighestMode = 1,  ///< Show the highest active sender mode
         AllModes = 2      ///< Show all active sender modes
@@ -393,11 +389,7 @@ private:
     mutable quint8 _senderHash;
 };
 
     mutable quint8 _senderHash;
 };
 
-#if QT_VERSION < 0x050000
-uint qHash(UiStyle::ItemFormatType key);
-#else
 uint qHash(UiStyle::ItemFormatType key, uint seed);
 uint qHash(UiStyle::ItemFormatType key, uint seed);
-#endif
 
 // ---- Operators for dealing with enums ----------------------------------------------------------
 
 
 // ---- Operators for dealing with enums ----------------------------------------------------------