From 5844aebeacebcb6ea83f8f52287f22a4dedbef61 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@digia.com>
Date: Fri, 27 Sep 2013 14:50:22 +0200
Subject: [PATCH 9/9] [Qt] Fix build with Qt 5.2 QtPosition module

https://bugs.webkit.org/show_bug.cgi?id=121089

Reviewed by Simon Hausmann.

.:

QtLocation -> QtPositioning

* Source/sync.profile:

Source/WebKit:

QtLocation -> QtPositioning

* WebKit1.pri:

Source/WebKit/qt:

QtLocation -> QtPositioning

* WebCoreSupport/GeolocationClientQt.cpp:

Source/WebKit2:

QtLocation -> QtPositioning

* Target.pri:
* UIProcess/qt/WebGeolocationProviderQt.cpp:
* WebKit2.pri:

Tools:

QtLocation -> QtPositioning. Make sure we set build type before doing configure checks
that might depend on them.

* qmake/mkspecs/features/default_pre.prf:
* qmake/mkspecs/features/features.prf:

Change-Id: I96a16559373a21513c4d83e53b6cee9f27682649
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156395 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
---
 Source/WebKit/WebKit1.pri                                |  2 +-
 Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp  |  2 +-
 Source/WebKit2/Target.pri                                |  2 +-
 Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp |  2 +-
 Source/WebKit2/WebKit2.pri                               |  2 +-
 Source/sync.profile                                      |  1 +
 Tools/qmake/mkspecs/features/default_pre.prf             | 16 ++++++++--------
 Tools/qmake/mkspecs/features/features.prf                |  4 +---
 Tools/qmake/mkspecs/features/features.pri                |  6 +++---
 9 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/Source/WebKit/WebKit1.pri b/Source/WebKit/WebKit1.pri
index ec1f063..949674a 100644
--- a/Source/WebKit/WebKit1.pri
+++ b/Source/WebKit/WebKit1.pri
@@ -22,7 +22,7 @@ enable?(DEVICE_ORIENTATION)|enable?(ORIENTATION_EVENTS) {
     QT += sensors
 }
 
-enable?(GEOLOCATION): QT += location
+enable?(GEOLOCATION): QT += positioning
 
 contains(CONFIG, texmap): DEFINES += WTF_USE_TEXTURE_MAPPER=1
 
diff --git a/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp b/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
index 26d1b40..b4c5189 100644
--- a/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
+++ b/Source/WebKit/qt/WebCoreSupport/GeolocationClientQt.cpp
@@ -36,7 +36,7 @@
 #include "QWebFrameAdapter.h"
 #include "QWebPageAdapter.h"
 
-#include <QtLocation/QGeoPositionInfoSource>
+#include <QtPositioning/QGeoPositionInfoSource>
 
 namespace WebCore {
 
diff --git a/Source/WebKit2/Target.pri b/Source/WebKit2/Target.pri
index aeefade..3295b21 100644
--- a/Source/WebKit2/Target.pri
+++ b/Source/WebKit2/Target.pri
@@ -936,7 +936,7 @@ enable?(TOUCH_EVENTS) {
 }
 
 
-enable?(GEOLOCATION): QT += location
+enable?(GEOLOCATION): QT += positioning
 
 use?(3D_GRAPHICS): WEBKIT += angle
 
diff --git a/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp b/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp
index 8b87f0a..d091d03 100644
--- a/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp
+++ b/Source/WebKit2/UIProcess/qt/WebGeolocationProviderQt.cpp
@@ -22,7 +22,7 @@
 #include "WebGeolocationProviderQt.h"
 
 #if ENABLE(GEOLOCATION)
-#include <QtLocation/QGeoPositionInfoSource>
+#include <QtPositioning/QGeoPositionInfoSource>
 
 namespace WebKit {
 
diff --git a/Source/WebKit2/WebKit2.pri b/Source/WebKit2/WebKit2.pri
index 9dfe535..d5327b0 100644
--- a/Source/WebKit2/WebKit2.pri
+++ b/Source/WebKit2/WebKit2.pri
@@ -84,4 +84,4 @@ linux-*: {
 
 have?(QTQUICK): QT += qml quick
 
-enable?(GEOLOCATION): QT += location
+enable?(GEOLOCATION): QT += positioning
diff --git a/Source/sync.profile b/Source/sync.profile
index 482cbcc..0a4ed8c 100644
--- a/Source/sync.profile
+++ b/Source/sync.profile
@@ -22,4 +22,5 @@
     "qtxmlpatterns" => "",
     "qtdeclarative" => "",
     "qtjsbackend" => "",
+    "qtlocation" => "",
 );
diff --git a/Tools/qmake/mkspecs/features/default_pre.prf b/Tools/qmake/mkspecs/features/default_pre.prf
index 57513ac..0ec3b7a 100644
--- a/Tools/qmake/mkspecs/features/default_pre.prf
+++ b/Tools/qmake/mkspecs/features/default_pre.prf
@@ -62,6 +62,14 @@ win32-msvc*: MAKEFILE_NOOP_COMMAND = @echo >NUL
 scratchbox: PYTHON = python2.6
 else: PYTHON = python
 
+# We use private_tests to detect developer build, since the destdir will
+# always be our webkit build dir. This might change as configure changes.
+contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build
+
+# By default we enable "production build", and build-webkit, which is
+# used by bots and developers, will disable it, to enable warnings etc.
+CONFIG += production_build
+
 # Run configure before making decisions that depend on the result
 root_project_file {
     load(configure)
@@ -74,20 +82,12 @@ unix:config_gccdepends {
     CONFIG += GNUmake gcc_MD_depends
 }
 
-# We use private_tests to detect developer build, since the destdir will
-# always be our webkit build dir. This might change as configure changes.
-contains(QT_CONFIG, private_tests): CONFIG += qt_developer_build
-
 # Set some defaults for specific platforms
 CONFIG += include_webinspector
 
 # Make sure we process the PKGCONFIG variable if applicable
 !mac: CONFIG += link_pkgconfig
 
-# By default we enable "production build", and build-webkit, which is
-# used by bots and developers, will disable it, to enable warnings etc.
-CONFIG += production_build
-
 # Limit the creation of thin archives to Linux, since only GNU's ar supports it.
 !debug_and_release:linux-g++*: CONFIG += gnu_thin_archives
 
diff --git a/Tools/qmake/mkspecs/features/features.prf b/Tools/qmake/mkspecs/features/features.prf
index ddbccf9..5946223 100644
--- a/Tools/qmake/mkspecs/features/features.prf
+++ b/Tools/qmake/mkspecs/features/features.prf
@@ -36,6 +36,7 @@ defineTest(detectFeatures) {
     haveQtModule(printsupport): WEBKIT_CONFIG += have_qtprintsupport
     haveQtModule(widgets): WEBKIT_CONFIG += have_qstyle
     haveQtModule(testlib): WEBKIT_CONFIG += have_qttestlib
+    haveQtModule(positioning): WEBKIT_CONFIG += have_qtpositioning geolocation
 
     config_libxml2: WEBKIT_CONFIG += use_libxml2
     config_libxslt: WEBKIT_CONFIG += xslt
@@ -94,9 +95,6 @@ defineTest(detectFeatures) {
     # Enable CSS shaders when CSS filters and WebGL are enabled
     enable?(css_filters):enable?(webgl): WEBKIT_CONFIG += css_shaders
 
-    # Geolocation support if QtMobility exists
-    haveQtModule(location): WEBKIT_CONFIG += geolocation
-
     # Orientation support
     haveQtModule(sensors): WEBKIT_CONFIG += orientation_events device_orientation
 
diff --git a/Tools/qmake/mkspecs/features/features.pri b/Tools/qmake/mkspecs/features/features.pri
index 91a34cf..5236b71 100644
--- a/Tools/qmake/mkspecs/features/features.pri
+++ b/Tools/qmake/mkspecs/features/features.pri
@@ -41,7 +41,7 @@ FEATURE_DEFAULTS = \
     ENABLE_DATALIST_ELEMENT=1 \
     ENABLE_DATA_TRANSFER_ITEMS=0 \
     ENABLE_DETAILS_ELEMENT=1 \
-    ENABLE_DEVICE_ORIENTATION=0 \
+    ENABLE_DEVICE_ORIENTATION=1 \
     ENABLE_DIRECTORY_UPLOAD=0 \
     ENABLE_DOWNLOAD_ATTRIBUTE=0 \
     ENABLE_FAST_MOBILE_SCROLLING=1 \
@@ -50,7 +50,7 @@ FEATURE_DEFAULTS = \
     ENABLE_FTPDIR=1 \
     ENABLE_FULLSCREEN_API=1 \
     ENABLE_GAMEPAD=0 \
-    ENABLE_GEOLOCATION=0 \
+    ENABLE_GEOLOCATION=1 \
     ENABLE_GESTURE_EVENTS=1 \
     ENABLE_HIGH_DPI_CANVAS=0 \
     ENABLE_ICONDATABASE=1 \
@@ -85,7 +85,7 @@ FEATURE_DEFAULTS = \
     ENABLE_NETSCAPE_PLUGIN_API=0 \
     ENABLE_NETWORK_INFO=0 \
     ENABLE_NOTIFICATIONS=1 \
-    ENABLE_ORIENTATION_EVENTS=0 \
+    ENABLE_ORIENTATION_EVENTS=1 \
     ENABLE_PAGE_VISIBILITY_API=1 \
     ENABLE_PROGRESS_ELEMENT=1 \
     ENABLE_PROXIMITY_EVENTS=0 \
-- 
1.9.0

