Title: [97409] trunk/Source/WebKit/qt
- Revision
- 97409
- Author
- [email protected]
- Date
- 2011-10-13 15:11:36 -0700 (Thu, 13 Oct 2011)
Log Message
[Qt] GeolocationClient cleanups
https://bugs.webkit.org/show_bug.cgi?id=69737
Patch by Adenilson Cavalcanti <[email protected]> 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:
Modified Paths
Diff
Modified: trunk/Source/WebKit/qt/ChangeLog (97408 => 97409)
--- trunk/Source/WebKit/qt/ChangeLog 2011-10-13 22:11:13 UTC (rev 97408)
+++ trunk/Source/WebKit/qt/ChangeLog 2011-10-13 22:11:36 UTC (rev 97409)
@@ -1,3 +1,19 @@
+2011-10-13 Adenilson Cavalcanti <[email protected]>
+
+ [Qt] GeolocationClient cleanups
+ https://bugs.webkit.org/show_bug.cgi?id=69737
+
+ 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:
+
2011-10-11 Simon Fraser <[email protected]>
Make custom scrollbar theme for use in DRT, to reduce pixel diffs between platforms
Modified: trunk/Source/WebKit/qt/QtWebKit.pro (97408 => 97409)
--- trunk/Source/WebKit/qt/QtWebKit.pro 2011-10-13 22:11:13 UTC (rev 97408)
+++ trunk/Source/WebKit/qt/QtWebKit.pro 2011-10-13 22:11:36 UTC (rev 97409)
@@ -287,6 +287,8 @@
}
contains(DEFINES, ENABLE_GEOLOCATION=1) {
+ qt5: QT += location
+
HEADERS += \
$$PWD/WebCoreSupport/GeolocationClientQt.h
SOURCES += \
Modified: trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp (97408 => 97409)
--- trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp 2011-10-13 22:11:13 UTC (rev 97408)
+++ trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp 2011-10-13 22:11:36 UTC (rev 97409)
@@ -37,7 +37,11 @@
#include "qwebpage.h"
#include "qwebpage_p.h"
-using namespace QtMobility;
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#include <QGeoPositionInfoSource>
+#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include <QtLocation/QGeoPositionInfoSource>
+#endif
namespace WebCore {
@@ -60,7 +64,7 @@
delete this;
}
-void GeolocationClientQt::positionUpdated(const QGeoPositionInfo &geoPosition)
+void GeolocationClientQt::positionUpdated(const QGeoPositionInfo& geoPosition)
{
if (!geoPosition.isValid())
return;
Modified: trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h (97408 => 97409)
--- trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h 2011-10-13 22:11:13 UTC (rev 97408)
+++ trunk/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.h 2011-10-13 22:11:36 UTC (rev 97409)
@@ -27,20 +27,27 @@
#define GeolocationClientQt_h
#include "GeolocationClient.h"
-#include <QGeoPositionInfoSource>
+
+#include <QObject>
#include <wtf/RefPtr.h>
-// FIXME: Remove usage of "using namespace" in a header file.
-// There is bug in qtMobility signal names are not full qualified when used with namespace
-// QtMobility namespace in slots throws up error and its required to be fixed in qtmobility.
+#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+#include <QGeoPositionInfo>
+namespace QtMobility {
+class QGeoPositionInfoSource;
+};
using namespace QtMobility;
+#elif QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include <QtLocation/QGeoPositionInfo>
+class QGeoPositionInfoSource;
+#endif
+
class QWebPage;
namespace WebCore {
-// This class provides a implementation of a GeolocationService for qtWebkit.
-// It uses QtMobility (v1.0.0) location service to get positions
+// This class provides an implementation of a GeolocationService for QtWebkit.
class GeolocationClientQt : public QObject, public GeolocationClient {
Q_OBJECT
@@ -59,13 +66,12 @@
virtual void cancelPermissionRequest(Geolocation*);
private Q_SLOTS:
- // QGeoPositionInfoSource
void positionUpdated(const QGeoPositionInfo&);
private:
const QWebPage* m_page;
RefPtr<GeolocationPosition> m_lastPosition;
- QtMobility::QGeoPositionInfoSource* m_location;
+ QGeoPositionInfoSource* m_location;
};
} // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes