Changeset 102763 in webkit


Ignore:
Timestamp:
Dec 14, 2011 3:27:59 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] Fix compilation of QtWebKit with --orientation-events without ENABLE_DEVICE_ORIENTATION
https://bugs.webkit.org/show_bug.cgi?id=74492

Patch by Alexander Færøy <alexander.faeroy@nokia.com> on 2011-12-14
Reviewed by Simon Hausmann.

.:

  • Source/api.pri:

Source/WebKit/qt:

  • Api/qwebframe.cpp:

(QWebFramePrivate::_q_orientationChanged):

  • Api/qwebframe_p.h:
  • WebCoreSupport/DeviceMotionProviderQt.cpp:
  • WebCoreSupport/DeviceMotionProviderQt.h:
  • WebCoreSupport/DeviceOrientationProviderQt.cpp:
  • WebCoreSupport/DeviceOrientationProviderQt.h:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r102760 r102763  
     12011-12-14  Alexander Færøy  <alexander.faeroy@nokia.com>
     2
     3        [Qt] Fix compilation of QtWebKit with --orientation-events without ENABLE_DEVICE_ORIENTATION
     4        https://bugs.webkit.org/show_bug.cgi?id=74492
     5
     6        Reviewed by Simon Hausmann.
     7
     8        * Source/api.pri:
     9
    1102011-12-14  Viatcheslav Ostapenko  <ostapenko.viatcheslav@nokia.com>
    211
  • trunk/Source/WebKit/qt/Api/qwebframe.cpp

    r101366 r102763  
    116116#include <qnetworkrequest.h>
    117117
     118#if ENABLE(ORIENTATION_EVENTS) && QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     119QTM_USE_NAMESPACE
     120#endif
     121
    118122using namespace WebCore;
    119123
     
    456460
    457461    switch (m_orientation.reading()->orientation()) {
    458     case QtMobility::QOrientationReading::TopUp:
     462    case QOrientationReading::TopUp:
    459463        orientation = 0;
    460464        break;
    461     case QtMobility::QOrientationReading::TopDown:
     465    case QOrientationReading::TopDown:
    462466        orientation = 180;
    463467        break;
    464     case QtMobility::QOrientationReading::LeftUp:
     468    case QOrientationReading::LeftUp:
    465469        orientation = -90;
    466470        break;
    467     case QtMobility::QOrientationReading::RightUp:
     471    case QOrientationReading::RightUp:
    468472        orientation = 90;
    469473        break;
    470     case QtMobility::QOrientationReading::FaceUp:
    471     case QtMobility::QOrientationReading::FaceDown:
     474    case QOrientationReading::FaceUp:
     475    case QOrientationReading::FaceDown:
    472476        // WebCore unable to handle it
    473477    default:
  • trunk/Source/WebKit/qt/Api/qwebframe_p.h

    r97571 r102763  
    3131#if ENABLE(ORIENTATION_EVENTS)
    3232#include "qorientationsensor.h"
    33 #endif
     33#endif // ENABLE(ORIENTATION_EVENTS).
    3434#include "qwebelement.h"
    3535#include "wtf/RefPtr.h"
     
    128128
    129129#if ENABLE(ORIENTATION_EVENTS)
    130     QtMobility::QOrientationSensor m_orientation;
    131 #endif
     130#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     131    QTM_NAMESPACE::QOrientationSensor m_orientation;
     132#else
     133    QOrientationSensor m_orientation;
     134#endif // QT_VERSION < QT_VERSION_CHECK(5, 0, 0).
     135#endif // ENABLE(ORIENTATION_EVENTS).
    132136
    133137private:
  • trunk/Source/WebKit/qt/ChangeLog

    r102759 r102763  
     12011-12-14  Alexander Færøy  <alexander.faeroy@nokia.com>
     2
     3        [Qt] Fix compilation of QtWebKit with --orientation-events without ENABLE_DEVICE_ORIENTATION
     4        https://bugs.webkit.org/show_bug.cgi?id=74492
     5
     6        Reviewed by Simon Hausmann.
     7
     8        * Api/qwebframe.cpp:
     9        (QWebFramePrivate::_q_orientationChanged):
     10        * Api/qwebframe_p.h:
     11        * WebCoreSupport/DeviceMotionProviderQt.cpp:
     12        * WebCoreSupport/DeviceMotionProviderQt.h:
     13        * WebCoreSupport/DeviceOrientationProviderQt.cpp:
     14        * WebCoreSupport/DeviceOrientationProviderQt.h:
     15
    1162011-12-14  Alexander Færøy  <alexander.faeroy@nokia.com>
    217
  • trunk/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp

    r102755 r102763  
    2222
    2323#include "DeviceOrientationProviderQt.h"
     24
     25#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     26QTM_USE_NAMESPACE
     27#endif
    2428
    2529namespace WebCore {
  • trunk/Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.h

    r102755 r102763  
    2727#include <QObject>
    2828
    29 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    30 QTM_USE_NAMESPACE
    31 #endif
    32 
    3329namespace WebCore {
    3430
    3531class DeviceOrientationProviderQt;
    3632
    37 class DeviceMotionProviderQt : public QObject, public QAccelerometerFilter {
     33class DeviceMotionProviderQt
     34    : public QObject
     35#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     36    , public QTM_NAMESPACE::QAccelerometerFilter {
     37#else
     38    , public QAccelerometerFilter {
     39#endif
    3840    Q_OBJECT
    3941public:
     
    4143    ~DeviceMotionProviderQt();
    4244
     45#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     46    bool filter(QTM_NAMESPACE::QAccelerometerReading*);
     47#else
    4348    bool filter(QAccelerometerReading*);
     49#endif
     50
    4451    void start();
    4552    void stop();
     
    5158private:
    5259    RefPtr<DeviceMotionData> m_motion;
     60#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     61    QTM_NAMESPACE::QAccelerometer m_acceleration;
     62#else
    5363    QAccelerometer m_acceleration;
     64#endif
    5465    DeviceOrientationProviderQt* m_deviceOrientation;
    5566};
  • trunk/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp

    r102755 r102763  
    2020#include "config.h"
    2121#include "DeviceOrientationProviderQt.h"
     22
     23#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     24QTM_USE_NAMESPACE
     25#endif
    2226
    2327namespace WebCore {
  • trunk/Source/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h

    r102755 r102763  
    2727#include <QRotationFilter>
    2828
    29 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
    30 QTM_USE_NAMESPACE
    31 #endif
    32 
    3329namespace WebCore {
    3430
    35 class DeviceOrientationProviderQt : public QRotationFilter {
     31class DeviceOrientationProviderQt
     32#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     33    : public QTM_NAMESPACE::QRotationFilter {
     34#else
     35    : public QRotationFilter {
     36#endif
    3637public:
    3738    DeviceOrientationProviderQt();
    3839
    3940    void setController(DeviceOrientationController*);
     41
     42#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     43    bool filter(QTM_NAMESPACE::QRotationReading*);
     44#else
    4045    bool filter(QRotationReading*);
     46#endif
     47
    4148    void start();
    4249    void stop();
     
    4855    RefPtr<DeviceOrientation> m_lastOrientation;
    4956    DeviceOrientationController* m_controller;
     57#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     58    QTM_NAMESPACE::QRotationSensor m_sensor;
     59#else
    5060    QRotationSensor m_sensor;
     61#endif
    5162};
    5263
  • trunk/Source/api.pri

    r102760 r102763  
    137137}
    138138
     139contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) || contains(DEFINES, ENABLE_ORIENTATION_EVENTS=1) {
     140    haveQt(5): QT += sensors
     141}
     142
    139143contains(DEFINES, ENABLE_DEVICE_ORIENTATION=1) {
    140     haveQt(5): QT += sensors
    141 
    142144    HEADERS += \
    143145        $$PWD/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.h \
Note: See TracChangeset for help on using the changeset viewer.