diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2015-02-02 18:49:18 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-02-03 11:49:14 +0000 |
commit | c5db8fc74a9d437a4e7c0af077aed7c1f1bd4e26 (patch) | |
tree | f7d42e0be35dd0ed85e74eaecdbbad4f319bc1d1 /src/widgets/util | |
parent | 611bcc3cd337fe77ea5d3b898d897582da6f7ee2 (diff) |
Make it more obvious that Q_WS_ is dead code, and should perhaps be ported
We still have a bunch of Q_WS_ ifdefs in our code, which are easy to
mistake for Q_OS_ ifdefs when quickly scanning the code. By renaming
the ifdefs we make it clear that the code in question is dead.
In incremental follow-ups, we can then selectively either remove, or
port, the pieces that are dead code.
Change-Id: Ib5ef3e9e0662d321f179f3e25122cacafff0f41f
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/widgets/util')
-rw-r--r-- | src/widgets/util/qflickgesture.cpp | 2 | ||||
-rw-r--r-- | src/widgets/util/qscroller.cpp | 6 | ||||
-rw-r--r-- | src/widgets/util/qscroller_mac.mm | 2 | ||||
-rw-r--r-- | src/widgets/util/qscrollerproperties.cpp | 4 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon.cpp | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/src/widgets/util/qflickgesture.cpp b/src/widgets/util/qflickgesture.cpp index f7abd008b7..d05a6ae91e 100644 --- a/src/widgets/util/qflickgesture.cpp +++ b/src/widgets/util/qflickgesture.cpp @@ -455,7 +455,7 @@ QGestureRecognizer::Result QFlickGestureRecognizer::recognize(QGesture *state, } break; -#if defined(Q_WS_MAC) +#if defined(Q_DEAD_CODE_FROM_QT4_MAC) // the only way to distinguish between real mouse wheels and wheel // events generated by the native 2 finger swipe gesture is to listen // for these events (according to Apple's Cocoa Event-Handling Guide) diff --git a/src/widgets/util/qscroller.cpp b/src/widgets/util/qscroller.cpp index 5235511b6d..a26e6d42b1 100644 --- a/src/widgets/util/qscroller.cpp +++ b/src/widgets/util/qscroller.cpp @@ -1002,12 +1002,12 @@ bool QScroller::handleInput(Input input, const QPointF &position, qint64 timesta return false; } -#if !defined(Q_WS_MAC) +#if !defined(Q_DEAD_CODE_FROM_QT4_MAC) // the Mac version is implemented in qscroller_mac.mm QPointF QScrollerPrivate::realDpi(int screen) { -# if defined(Q_WS_X11) && !defined(QT_NO_XRANDR) +# if defined(Q_DEAD_CODE_FROM_QT4_X11) && !defined(QT_NO_XRANDR) if (X11 && X11->use_xrandr && X11->ptrXRRSizes && X11->ptrXRRRootToScreen) { int nsizes = 0; // QDesktopWidget is based on Xinerama screens, which do not always @@ -1033,7 +1033,7 @@ QPointF QScrollerPrivate::realDpi(int screen) return QPointF(w->physicalDpiX(), w->physicalDpiY()); } -#endif // !Q_WS_MAC +#endif // !Q_DEAD_CODE_FROM_QT4_MAC /*! \internal diff --git a/src/widgets/util/qscroller_mac.mm b/src/widgets/util/qscroller_mac.mm index 0f9f2a028c..08d70923a1 100644 --- a/src/widgets/util/qscroller_mac.mm +++ b/src/widgets/util/qscroller_mac.mm @@ -41,7 +41,7 @@ #include <QtCore/qglobal.h> -#ifdef Q_WS_MAC +#ifdef Q_DEAD_CODE_FROM_QT4_MAC #import <Cocoa/Cocoa.h> diff --git a/src/widgets/util/qscrollerproperties.cpp b/src/widgets/util/qscrollerproperties.cpp index 193396c4fc..073fcaf2e6 100644 --- a/src/widgets/util/qscrollerproperties.cpp +++ b/src/widgets/util/qscrollerproperties.cpp @@ -34,7 +34,7 @@ #include <QPointer> #include <QObject> #include <QtCore/qmath.h> -#ifdef Q_WS_WIN +#ifdef Q_DEAD_CODE_FROM_QT4_WIN # include <QLibrary> #endif @@ -67,7 +67,7 @@ QScrollerPropertiesPrivate *QScrollerPropertiesPrivate::defaults() spp.overshootDragDistanceFactor = qreal(1); spp.overshootScrollDistanceFactor = qreal(0.5); spp.overshootScrollTime = qreal(0.7); -# ifdef Q_WS_WIN +# ifdef Q_DEAD_CODE_FROM_QT4_WIN if (QLibrary::resolve(QLatin1String("UxTheme"), "BeginPanningFeedback")) spp.overshootScrollTime = qreal(0.35); # endif diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index f322b083fc..c0f9538c0a 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -283,7 +283,7 @@ bool QSystemTrayIcon::isVisible() const */ bool QSystemTrayIcon::event(QEvent *e) { -#if defined(Q_WS_X11) +#if defined(Q_DEAD_CODE_FROM_QT4_X11) if (e->type() == QEvent::ToolTip) { Q_D(QSystemTrayIcon); return d->sys->deliverToolTipEvent(e); @@ -586,7 +586,7 @@ void QBalloonTip::balloon(const QPoint& pos, int msecs, bool showArrow) } QPainterPath path; -#if defined(QT_NO_XSHAPE) && defined(Q_WS_X11) +#if defined(QT_NO_XSHAPE) && defined(Q_DEAD_CODE_FROM_QT4_X11) // XShape is required for setting the mask, so we just // draw an ugly square when its not available path.moveTo(0, 0); |