Changeset 97409 in webkit


Ignore:
Timestamp:
Oct 13, 2011 3:11:36 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] GeolocationClient cleanups
https://bugs.webkit.org/show_bug.cgi?id=69737

Patch by Adenilson Cavalcanti <adenilson.silva@openbossa.org> on 2011-10-13
Reviewed by Kenneth Rohde Christiansen.

Qt5 has a location module, so no need to use an external
library like Qt Mobility. This patch will allow the GeolocationClientQt
to compile with both Qt5 and Qt4.

  • QtWebKit.pro:
  • WebCoreSupport/GeolocationClientQt.cpp:

(WebCore::GeolocationClientQt::positionUpdated):

  • WebCoreSupport/GeolocationClientQt.h:
Location:
trunk/Source/WebKit/qt
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/qt/ChangeLog

    r97227 r97409  
     12011-10-13  Adenilson Cavalcanti  <adenilson.silva@openbossa.org>
     2
     3        [Qt] GeolocationClient cleanups
     4        https://bugs.webkit.org/show_bug.cgi?id=69737
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        Qt5 has a location module, so no need to use an external
     9        library like Qt Mobility. This patch will allow the GeolocationClientQt
     10        to compile with both Qt5 and Qt4.
     11
     12        * QtWebKit.pro:
     13        * WebCoreSupport/GeolocationClientQt.cpp:
     14        (WebCore::GeolocationClientQt::positionUpdated):
     15        * WebCoreSupport/GeolocationClientQt.h:
     16
    1172011-10-11  Simon Fraser  <simon.fraser@apple.com>
    218
  • trunk/Source/WebKit/qt/QtWebKit.pro

    r97387 r97409  
    288288
    289289contains(DEFINES, ENABLE_GEOLOCATION=1) {
     290     qt5: QT += location
     291
    290292     HEADERS += \
    291293        $$PWD/WebCoreSupport/GeolocationClientQt.h
  • trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp

    r95901 r97409  
    3838#include "qwebpage_p.h"
    3939
    40 using namespace QtMobility;
     40#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     41#include <QGeoPositionInfoSource>
     42#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     43#include <QtLocation/QGeoPositionInfoSource>
     44#endif
    4145
    4246namespace WebCore {
     
    6165}
    6266
    63 void GeolocationClientQt::positionUpdated(const QGeoPositionInfo &geoPosition)
     67void GeolocationClientQt::positionUpdated(const QGeoPositionInfo& geoPosition)
    6468{
    6569    if (!geoPosition.isValid())
  • trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h

    r95901 r97409  
    2828
    2929#include "GeolocationClient.h"
    30 #include <QGeoPositionInfoSource>
     30
     31#include <QObject>
    3132#include <wtf/RefPtr.h>
    3233
    33 // FIXME: Remove usage of "using namespace" in a header file.
    34 // There is bug in qtMobility signal names are not full qualified when used with namespace
    35 // QtMobility namespace in slots throws up error and its required to be fixed in qtmobility.
     34#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     35#include <QGeoPositionInfo>
     36namespace QtMobility {
     37class QGeoPositionInfoSource;
     38};
    3639using namespace QtMobility;
     40#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
     41#include <QtLocation/QGeoPositionInfo>
     42class QGeoPositionInfoSource;
     43#endif
     44
    3745
    3846class QWebPage;
     
    4048namespace WebCore {
    4149
    42 // This class provides a implementation of a GeolocationService for qtWebkit.
    43 // It uses QtMobility (v1.0.0) location service to get positions
     50// This class provides an implementation of a GeolocationService for QtWebkit.
    4451class GeolocationClientQt : public QObject, public GeolocationClient {
    4552    Q_OBJECT
     
    6067
    6168private Q_SLOTS:
    62     // QGeoPositionInfoSource
    6369    void positionUpdated(const QGeoPositionInfo&);
    6470
     
    6672    const QWebPage* m_page;
    6773    RefPtr<GeolocationPosition> m_lastPosition;
    68     QtMobility::QGeoPositionInfoSource* m_location;
     74    QGeoPositionInfoSource* m_location;
    6975};
    7076
Note: See TracChangeset for help on using the changeset viewer.