From 81362834a78f1ab87c0c8d6331e759199d33623b Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 25 Feb 2017 11:24:20 +0100 Subject: qxt: remove ifdefs for Qt4. We're not using it again. --- qxt-mini/qxtglobalshortcut.cpp | 13 +------------ qxt-mini/qxtglobalshortcut_p.h | 15 +++------------ 2 files changed, 4 insertions(+), 24 deletions(-) diff --git a/qxt-mini/qxtglobalshortcut.cpp b/qxt-mini/qxtglobalshortcut.cpp index 45576d37..f0a020ff 100644 --- a/qxt-mini/qxtglobalshortcut.cpp +++ b/qxt-mini/qxtglobalshortcut.cpp @@ -35,9 +35,6 @@ #ifndef Q_OS_MAC int QxtGlobalShortcutPrivate::ref = 0; -# if QT_VERSION < QT_VERSION_CHECK(5,0,0) -QAbstractEventDispatcher::EventFilter QxtGlobalShortcutPrivate::prevEventFilter = 0; -# endif #endif // Q_OS_MAC QHash, QxtGlobalShortcut*> QxtGlobalShortcutPrivate::shortcuts; @@ -45,11 +42,7 @@ QxtGlobalShortcutPrivate::QxtGlobalShortcutPrivate() : enabled(true), key(Qt::Ke { #ifndef Q_OS_MAC if (ref == 0) { -# if QT_VERSION < QT_VERSION_CHECK(5,0,0) - prevEventFilter = QAbstractEventDispatcher::instance()->setEventFilter(eventFilter); -# else QAbstractEventDispatcher::instance()->installNativeEventFilter(this); -#endif } ++ref; #endif // Q_OS_MAC @@ -60,13 +53,9 @@ QxtGlobalShortcutPrivate::~QxtGlobalShortcutPrivate() #ifndef Q_OS_MAC --ref; if (ref == 0) { - QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance(); + QAbstractEventDispatcher *ed = QAbstractEventDispatcher::instance(qApp->thread()); if (ed != 0) { -# if QT_VERSION < QT_VERSION_CHECK(5,0,0) - ed->setEventFilter(prevEventFilter); -# else ed->removeNativeEventFilter(this); -# endif } } #endif // Q_OS_MAC diff --git a/qxt-mini/qxtglobalshortcut_p.h b/qxt-mini/qxtglobalshortcut_p.h index 407f968e..9eadbc7f 100644 --- a/qxt-mini/qxtglobalshortcut_p.h +++ b/qxt-mini/qxtglobalshortcut_p.h @@ -36,19 +36,14 @@ #include #include -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) #include -#endif -class QxtGlobalShortcutPrivate : public QxtPrivate -#if QT_VERSION >= QT_VERSION_CHECK(5,0,0) - ,public QAbstractNativeEventFilter -#endif +class QxtGlobalShortcutPrivate : public QxtPrivate, public QAbstractNativeEventFilter { public: QXT_DECLARE_PUBLIC(QxtGlobalShortcut) QxtGlobalShortcutPrivate(); - ~QxtGlobalShortcutPrivate(); + ~QxtGlobalShortcutPrivate() override; bool enabled; Qt::Key key; @@ -59,12 +54,8 @@ public: static bool error; static int ref; -# if QT_VERSION < QT_VERSION_CHECK(5,0,0) - static QAbstractEventDispatcher::EventFilter prevEventFilter; -# else static bool eventFilter(void* message); - virtual bool nativeEventFilter(const QByteArray & eventType, void * message, long * result); -# endif // QT_VERSION < QT_VERSION_CHECK(5,0,0) + bool nativeEventFilter(const QByteArray & eventType, void * message, long * result) override; static void activateShortcut(quint32 nativeKey, quint32 nativeMods); -- cgit v1.2.3