Title: [110050] trunk
Revision
110050
Author
[email protected]
Date
2012-03-07 05:53:28 -0800 (Wed, 07 Mar 2012)

Log Message

[Qt] Fix compilation without QtQuick1 https://bugs.webkit.org/show_bug.cgi?id=80503

Reviewed by Tor Arne Vestbø.

.:

* Source/tests.pri: Compile qml1 tests only with Qt 4 for the moment.

Source/WebKit/qt:

Compile and enable the QtQuick1/QML1 plugin and webview
only if we're using Qt 4 at the moment. QQuick1 clashes
with QQuick2 right now because both declare QDeclarativeEngine
and friends as classes.

* declarative/plugin.cpp:
(WebKitQmlPlugin::registerTypes):
* declarative/public.pri:
* tests/tests.pri:

Tools:

Introduce HAVE_QQUICK1 as feature and added haveQtModule
as convenience function.

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

Modified Paths

Diff

Modified: trunk/ChangeLog (110049 => 110050)


--- trunk/ChangeLog	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/ChangeLog	2012-03-07 13:53:28 UTC (rev 110050)
@@ -1,3 +1,12 @@
+2012-03-07  Simon Hausmann  <[email protected]>
+
+        [Qt] Fix compilation without QtQuick1
+        https://bugs.webkit.org/show_bug.cgi?id=80503
+
+        Reviewed by Tor Arne Vestbø.
+
+        * Source/tests.pri: Compile qml1 tests only with Qt 4 for the moment.
+
 2012-03-07  Mark Rowe  <[email protected]>
 
         Teach make to build WTF.

Modified: trunk/Source/WebKit/qt/ChangeLog (110049 => 110050)


--- trunk/Source/WebKit/qt/ChangeLog	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Source/WebKit/qt/ChangeLog	2012-03-07 13:53:28 UTC (rev 110050)
@@ -1,3 +1,20 @@
+2012-03-07  Simon Hausmann  <[email protected]>
+
+        [Qt] Fix compilation without QtQuick1
+        https://bugs.webkit.org/show_bug.cgi?id=80503
+
+        Reviewed by Tor Arne Vestbø.
+
+        Compile and enable the QtQuick1/QML1 plugin and webview
+        only if we're using Qt 4 at the moment. QQuick1 clashes
+        with QQuick2 right now because both declare QDeclarativeEngine
+        and friends as classes.
+
+        * declarative/plugin.cpp:
+        (WebKitQmlPlugin::registerTypes):
+        * declarative/public.pri:
+        * tests/tests.pri:
+
 2012-03-07  Kangil Han  <[email protected]>
 
         [DRT] Remove PlainTextController implementations.

Modified: trunk/Source/WebKit/qt/declarative/plugin.cpp (110049 => 110050)


--- trunk/Source/WebKit/qt/declarative/plugin.cpp	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Source/WebKit/qt/declarative/plugin.cpp	2012-03-07 13:53:28 UTC (rev 110050)
@@ -17,7 +17,9 @@
     Boston, MA 02110-1301, USA.
 */
 
+#if defined(HAVE_QQUICK1)
 #include "qdeclarativewebview_p.h"
+#endif
 
 #include <QtDeclarative/qdeclarative.h>
 #include <QtDeclarative/qdeclarativeextensionplugin.h>
@@ -49,6 +51,7 @@
     virtual void registerTypes(const char* uri)
     {
         Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit"));
+#if defined(HAVE_QQUICK1)
         qmlRegisterType<QDeclarativeWebSettings>();
         qmlRegisterType<QDeclarativeWebView>(uri, 1, 0, "WebView");
 #ifdef Q_REVISION
@@ -56,6 +59,7 @@
         qmlRegisterRevision<QDeclarativeWebView, 0>("QtWebKit", 1, 0);
         qmlRegisterRevision<QDeclarativeWebView, 1>("QtWebKit", 1, 1);
 #endif
+#endif
 
 #if defined(HAVE_WEBKIT2)
         qmlRegisterType<QQuickWebView>(uri, 3, 0, "WebView");

Modified: trunk/Source/WebKit/qt/declarative/public.pri (110049 => 110050)


--- trunk/Source/WebKit/qt/declarative/public.pri	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Source/WebKit/qt/declarative/public.pri	2012-03-07 13:53:28 UTC (rev 110050)
@@ -27,8 +27,13 @@
 CONFIG += qtwebkit qtwebkit-private
 
 QT += declarative
-haveQt(5): QT += widgets quick quick1
+haveQt(5): QT += widgets quick
 
+contains(DEFINES, HAVE_QQUICK1=1) {
+    SOURCES += qdeclarativewebview.cpp
+    HEADERS += qdeclarativewebview_p.h
+}
+
 DESTDIR = $${ROOT_BUILD_DIR}/imports/$${TARGET.module_name}
 
 CONFIG += rpath
@@ -40,8 +45,7 @@
     ../../../_javascript_Core/runtime \
     ../../../_javascript_Core/wtf
 
-SOURCES += qdeclarativewebview.cpp plugin.cpp
-HEADERS += qdeclarativewebview_p.h
+SOURCES += plugin.cpp
 
 !no_webkit2: {
     DEFINES += HAVE_WEBKIT2

Modified: trunk/Source/WebKit/qt/tests/tests.pri (110049 => 110050)


--- trunk/Source/WebKit/qt/tests/tests.pri	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Source/WebKit/qt/tests/tests.pri	2012-03-07 13:53:28 UTC (rev 110050)
@@ -21,11 +21,7 @@
 
 CONFIG += qtwebkit
 
-haveQt(5) {
-    QT += declarative quick1
-} else {
-    contains(QT_CONFIG, declarative): QT += declarative
-}
+haveQt(4): haveQtModule(declarative): QT += declarative
 
 # This define is used by some tests to look up resources in the source tree
 DEFINES += TESTS_SOURCE_DIR=\\\"$$PWD/\\\"

Modified: trunk/Source/tests.pri (110049 => 110050)


--- trunk/Source/tests.pri	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Source/tests.pri	2012-03-07 13:53:28 UTC (rev 110050)
@@ -7,6 +7,8 @@
 TEMPLATE = subdirs
 CONFIG += ordered
 
+load(features)
+
 WEBKIT_TESTS_DIR = $$PWD/WebKit/qt/tests
 
 SUBDIRS += \
@@ -26,9 +28,7 @@
     SUBDIRS += $$WEBKIT_TESTS_DIR/MIMESniffing
 }
 
-contains(QT_CONFIG, declarative)|contains(QT_CONFIG, qtquick1) {
-    SUBDIRS += $$WEBKIT_TESTS_DIR/qdeclarativewebview
-}
+contains(DEFINES, HAVE_QQUICK1=1): SUBDIRS += $$WEBKIT_TESTS_DIR/qdeclarativewebview
 
 # Benchmarks
 SUBDIRS += \

Modified: trunk/Tools/ChangeLog (110049 => 110050)


--- trunk/Tools/ChangeLog	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Tools/ChangeLog	2012-03-07 13:53:28 UTC (rev 110050)
@@ -1,3 +1,16 @@
+2012-03-07  Simon Hausmann  <[email protected]>
+
+        [Qt] Fix compilation without QtQuick1
+        https://bugs.webkit.org/show_bug.cgi?id=80503
+
+        Reviewed by Tor Arne Vestbø.
+
+        Introduce HAVE_QQUICK1 as feature and added haveQtModule
+        as convenience function.
+
+        * qmake/mkspecs/features/features.prf:
+        * qmake/mkspecs/features/functions.prf:
+
 2012-03-07  Zoltan Horvath  <[email protected]>
 
         [Qt] Add qmake config tests for JPEG and PNG library

Modified: trunk/Tools/qmake/mkspecs/features/features.prf (110049 => 110050)


--- trunk/Tools/qmake/mkspecs/features/features.prf	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Tools/qmake/mkspecs/features/features.prf	2012-03-07 13:53:28 UTC (rev 110050)
@@ -221,6 +221,12 @@
     DEFINES += ENABLE_JAVASCRIPT_DEBUGGER=0
 }
 
+haveQt(4) {
+    haveQtModule(declarative): DEFINES += HAVE_QQUICK1=1
+}
+### FIXME: Add Qt 5 QQuick1 support once QDeclarativeEngine in QQuick2
+### is called QmlEngine and it is safe for us to use QQuick1 again.
+
 ## Forward enabled feature macros to _javascript_ enabled features macros
 FEATURE_DEFINES_JAVASCRIPT = LANGUAGE_JAVASCRIPT=1
 v8: FEATURE_DEFINES_JAVASCRIPT += V8_BINDING=1

Modified: trunk/Tools/qmake/mkspecs/features/functions.prf (110049 => 110050)


--- trunk/Tools/qmake/mkspecs/features/functions.prf	2012-03-07 13:32:58 UTC (rev 110049)
+++ trunk/Tools/qmake/mkspecs/features/functions.prf	2012-03-07 13:53:28 UTC (rev 110050)
@@ -204,6 +204,14 @@
     return(true)
 }
 
+defineTest(haveQtModule) {
+    unset(module)
+    module = $$1
+    haveQt(4):contains(QT_CONFIG, $$module): return(true)
+    haveQt(5):!isEmpty(QT.$$module.name): return(true)
+    return(false)
+}
+
 defineTest(prependEach) {
     unset(variable)
     unset(prefix)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to