Title: [98721] trunk
Revision
98721
Author
[email protected]
Date
2011-10-28 06:06:34 -0700 (Fri, 28 Oct 2011)

Log Message

[Qt] Adapt to QSG* to QQuick* API change in qtdeclarative
https://bugs.webkit.org/show_bug.cgi?id=70494

Patch by Simon Hausmann <[email protected]> on 2011-10-28
Reviewed by Kenneth Christiansen.

Use QQuick* instead of QSG* as well as QStandardPaths
instead of QDesktopLocation.

Source/WebKit/qt:

* Api/qwebsettings.cpp:
(QWebSettings::enablePersistentStorage):

Source/WebKit2:

* UIProcess/API/qt/qdesktopwebview.cpp:
(QDesktopWebView::QDesktopWebView):
(QDesktopWebView::geometryChanged):
(QDesktopWebView::event):
(QDesktopWebViewPrivate::engine):
* UIProcess/API/qt/qdesktopwebview.h:
* UIProcess/API/qt/qtouchwebpage.cpp:
(QTouchWebPage::QTouchWebPage):
(QTouchWebPage::event):
(QTouchWebPage::geometryChanged):
* UIProcess/API/qt/qtouchwebpage.h:
* UIProcess/API/qt/qtouchwebview.cpp:
(QTouchWebView::QTouchWebView):
(QTouchWebView::geometryChanged):
(QTouchWebView::touchEvent):
* UIProcess/API/qt/qtouchwebview.h:
* UIProcess/API/qt/tests/testwindow.h:
(TestWindow::TestWindow):
(TestWindow::resizeEvent):
* UIProcess/qt/QtDesktopWebPageProxy.cpp:
(QtDesktopWebPageProxy::createPopupMenuProxy):
* UIProcess/qt/QtSGUpdateQueue.cpp:
(WebKit::QtSGUpdateQueue::QtSGUpdateQueue):
* UIProcess/qt/QtSGUpdateQueue.h:
* UIProcess/qt/QtTouchViewInterface.cpp:
(WebKit::QtTouchViewInterface::engine):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::contentRectInViewportCoordinates):
(WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
* UIProcess/qt/QtViewportInteractionEngine.h:
* UIProcess/qt/WebContextQt.cpp:
(WebKit::defaultDataLocation):
* UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp:
(WebKit::WebPopupMenuProxyQtDesktop::WebPopupMenuProxyQtDesktop):
* UIProcess/qt/WebPopupMenuProxyQtDesktop.h:
(WebKit::WebPopupMenuProxyQtDesktop::create):

Tools:

* MiniBrowser/qt/BrowserWindow.cpp:
(BrowserWindow::BrowserWindow):
* MiniBrowser/qt/BrowserWindow.h:
* QtTestBrowser/cookiejar.cpp:
(TestBrowserCookieJar::TestBrowserCookieJar):
* QtTestBrowser/launcherwindow.cpp:
(LauncherWindow::setDiskCache):
* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/qt/PlatformWebViewQt.cpp:
(WTR::WrapperWindow::WrapperWindow):
(WTR::WrapperWindow::handleStatusChanged):

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/Api/qwebsettings.cpp (98720 => 98721)


--- trunk/Source/WebKit/qt/Api/qwebsettings.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit/qt/Api/qwebsettings.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -45,7 +45,11 @@
 #include "FileSystem.h"
 
 #include <QApplication>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include <QStandardPaths>
+#else
 #include <QDesktopServices>
+#endif
 #include <QDir>
 #include <QHash>
 #include <QSharedData>
@@ -1129,7 +1133,11 @@
 
     if (path.isEmpty()) {
 
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+        storagePath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
+#else
         storagePath = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+#endif
         if (storagePath.isEmpty())
             storagePath = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
     } else

Modified: trunk/Source/WebKit/qt/ChangeLog (98720 => 98721)


--- trunk/Source/WebKit/qt/ChangeLog	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-10-28 13:06:34 UTC (rev 98721)
@@ -1,3 +1,16 @@
+2011-10-28  Simon Hausmann  <[email protected]>
+
+        [Qt] Adapt to QSG* to QQuick* API change in qtdeclarative
+        https://bugs.webkit.org/show_bug.cgi?id=70494
+
+        Reviewed by Kenneth Christiansen.
+
+        Use QQuick* instead of QSG* as well as QStandardPaths
+        instead of QDesktopLocation.
+
+        * Api/qwebsettings.cpp:
+        (QWebSettings::enablePersistentStorage):
+
 2011-10-27  Helder Correia  <[email protected]>
 
         [Qt] Failure to build when QT_NO_MENU defined

Modified: trunk/Source/WebKit2/ChangeLog (98720 => 98721)


--- trunk/Source/WebKit2/ChangeLog	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/ChangeLog	2011-10-28 13:06:34 UTC (rev 98721)
@@ -1,3 +1,50 @@
+2011-10-28  Simon Hausmann  <[email protected]>
+
+        [Qt] Adapt to QSG* to QQuick* API change in qtdeclarative
+        https://bugs.webkit.org/show_bug.cgi?id=70494
+
+        Reviewed by Kenneth Christiansen.
+
+        Use QQuick* instead of QSG* as well as QStandardPaths
+        instead of QDesktopLocation.
+
+        * UIProcess/API/qt/qdesktopwebview.cpp:
+        (QDesktopWebView::QDesktopWebView):
+        (QDesktopWebView::geometryChanged):
+        (QDesktopWebView::event):
+        (QDesktopWebViewPrivate::engine):
+        * UIProcess/API/qt/qdesktopwebview.h:
+        * UIProcess/API/qt/qtouchwebpage.cpp:
+        (QTouchWebPage::QTouchWebPage):
+        (QTouchWebPage::event):
+        (QTouchWebPage::geometryChanged):
+        * UIProcess/API/qt/qtouchwebpage.h:
+        * UIProcess/API/qt/qtouchwebview.cpp:
+        (QTouchWebView::QTouchWebView):
+        (QTouchWebView::geometryChanged):
+        (QTouchWebView::touchEvent):
+        * UIProcess/API/qt/qtouchwebview.h:
+        * UIProcess/API/qt/tests/testwindow.h:
+        (TestWindow::TestWindow):
+        (TestWindow::resizeEvent):
+        * UIProcess/qt/QtDesktopWebPageProxy.cpp:
+        (QtDesktopWebPageProxy::createPopupMenuProxy):
+        * UIProcess/qt/QtSGUpdateQueue.cpp:
+        (WebKit::QtSGUpdateQueue::QtSGUpdateQueue):
+        * UIProcess/qt/QtSGUpdateQueue.h:
+        * UIProcess/qt/QtTouchViewInterface.cpp:
+        (WebKit::QtTouchViewInterface::engine):
+        * UIProcess/qt/QtViewportInteractionEngine.cpp:
+        (WebKit::contentRectInViewportCoordinates):
+        (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
+        * UIProcess/qt/QtViewportInteractionEngine.h:
+        * UIProcess/qt/WebContextQt.cpp:
+        (WebKit::defaultDataLocation):
+        * UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp:
+        (WebKit::WebPopupMenuProxyQtDesktop::WebPopupMenuProxyQtDesktop):
+        * UIProcess/qt/WebPopupMenuProxyQtDesktop.h:
+        (WebKit::WebPopupMenuProxyQtDesktop::create):
+
 2011-10-28  Kenneth Rohde Christiansen  <[email protected]>
 
         [Qt] Make the kinetic engine use the same curve and constants as on the N9

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -29,9 +29,9 @@
 #include <QGraphicsSceneResizeEvent>
 #include <QStyleOptionGraphicsItem>
 #include <QtDeclarative/qdeclarativeengine.h>
-#include <QtDeclarative/qsgcanvas.h>
-#include <QtDeclarative/qsgitem.h>
-#include <QtDeclarative/qsgview.h>
+#include <QtDeclarative/qquickcanvas.h>
+#include <QtDeclarative/qquickitem.h>
+#include <QtDeclarative/qquickview.h>
 #include <QtGui/QCursor>
 #include <QtGui/QDrag>
 #include <QtGui/QFocusEvent>
@@ -242,15 +242,15 @@
 #endif
 }
 
-QDesktopWebView::QDesktopWebView(QSGItem* parent)
-    : QSGPaintedItem(parent)
+QDesktopWebView::QDesktopWebView(QQuickItem* parent)
+    : QQuickPaintedItem(parent)
     , d(new QDesktopWebViewPrivate(this))
 {
     init();
 }
 
-QDesktopWebView::QDesktopWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, QSGItem* parent)
-    : QSGPaintedItem(parent)
+QDesktopWebView::QDesktopWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, QQuickItem* parent)
+    : QQuickPaintedItem(parent)
     , d(new QDesktopWebViewPrivate(this, contextRef, pageGroupRef))
 {
     init();
@@ -397,7 +397,7 @@
 
 void QDesktopWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
 {
-    QSGPaintedItem::geometryChanged(newGeometry, oldGeometry);
+    QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry);
     if (newGeometry.size() != oldGeometry.size())
         d->page.setDrawingAreaSize(newGeometry.size().toSize());
 }
@@ -418,8 +418,8 @@
     if (d->page.handleEvent(ev))
         return true;
     if (ev->type() == QEvent::InputMethod)
-        return false; // This is necessary to avoid an endless loop in connection with QSGItem::event().
-    return QSGItem::event(ev);
+        return false; // This is necessary to avoid an endless loop in connection with QQuickItem::event().
+    return QQuickItem::event(ev);
 }
 
 WKPageRef QDesktopWebView::pageRef() const
@@ -441,7 +441,7 @@
 
 QJSEngine* QDesktopWebViewPrivate::engine()
 {
-    QSGView* view = qobject_cast<QSGView*>(q->canvas());
+    QQuickView* view = qobject_cast<QQuickView*>(q->canvas());
     if (view)
         return view->engine();
     return 0;

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -23,7 +23,7 @@
 
 #include "qwebkitglobal.h"
 #include <QUrl>
-#include <QtDeclarative/qsgpainteditem.h>
+#include <QtDeclarative/qquickpainteditem.h>
 #include <WebKit2/WKBase.h>
 
 class QDesktopWebViewPrivate;
@@ -50,7 +50,7 @@
     class PlatformWebView;
 }
 
-class QWEBKIT_EXPORT QDesktopWebView : public QSGPaintedItem {
+class QWEBKIT_EXPORT QDesktopWebView : public QQuickPaintedItem {
     Q_OBJECT
     Q_PROPERTY(QString title READ title NOTIFY titleChanged)
     Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
@@ -72,7 +72,7 @@
         HttpError
     };
 
-    QDesktopWebView(QSGItem* parent = 0);
+    QDesktopWebView(QQuickItem* parent = 0);
     virtual ~QDesktopWebView();
 
     QUrl url() const;
@@ -120,7 +120,7 @@
     virtual bool event(QEvent*);
 
 private:
-    QDesktopWebView(WKContextRef, WKPageGroupRef, QSGItem* parent = 0);
+    QDesktopWebView(WKContextRef, WKPageGroupRef, QQuickItem* parent = 0);
     WKPageRef pageRef() const;
 
     void init();

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -31,8 +31,8 @@
 #include <QSGEngine>
 #include <QUrl>
 
-QTouchWebPage::QTouchWebPage(QSGItem* parent)
-    : QSGItem(parent)
+QTouchWebPage::QTouchWebPage(QQuickItem* parent)
+    : QQuickItem(parent)
     , d(new QTouchWebPagePrivate(this))
 {
     setFlag(ItemHasContents);
@@ -87,7 +87,7 @@
 {
     if (d->page->handleEvent(ev))
         return true;
-    return QSGItem::event(ev);
+    return QQuickItem::event(ev);
 }
 
 void QTouchWebPage::keyPressEvent(QKeyEvent* event)
@@ -122,7 +122,7 @@
 
 void QTouchWebPage::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
 {
-    QSGItem::geometryChanged(newGeometry, oldGeometry);
+    QQuickItem::geometryChanged(newGeometry, oldGeometry);
     if (newGeometry.size() != oldGeometry.size())
         d->page->setDrawingAreaSize(newGeometry.size().toSize());
 }

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -23,7 +23,7 @@
 
 #include "qwebkitglobal.h"
 
-#include <QtDeclarative/qsgitem.h>
+#include <QtDeclarative/qquickitem.h>
 #include <QSharedPointer>
 
 class QTouchWebPagePrivate;
@@ -35,7 +35,7 @@
 class QtTouchViewInterface;
 }
 
-class QWEBKIT_EXPORT QTouchWebPage : public QSGItem {
+class QWEBKIT_EXPORT QTouchWebPage : public QQuickItem {
     Q_OBJECT
     Q_PROPERTY(QString title READ title NOTIFY titleChanged)
     Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
@@ -50,7 +50,7 @@
         HttpError
     };
 
-    QTouchWebPage(QSGItem* parent = 0);
+    QTouchWebPage(QQuickItem* parent = 0);
 
     virtual ~QTouchWebPage();
 

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -92,11 +92,11 @@
     updateViewportConstraints();
 }
 
-QTouchWebView::QTouchWebView(QSGItem* parent)
-    : QSGItem(parent)
+QTouchWebView::QTouchWebView(QQuickItem* parent)
+    : QQuickItem(parent)
     , d(new QTouchWebViewPrivate(this))
 {
-    setFlags(QSGItem::ItemClipsChildrenToShape);
+    setFlags(QQuickItem::ItemClipsChildrenToShape);
     connect(this, SIGNAL(visibleChanged()), SLOT(onVisibleChanged()));
 }
 
@@ -112,7 +112,7 @@
 
 void QTouchWebView::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
 {
-    QSGItem::geometryChanged(newGeometry, oldGeometry);
+    QQuickItem::geometryChanged(newGeometry, oldGeometry);
     if (newGeometry.size() != oldGeometry.size()) {
         d->updateViewportConstraints();
         d->_q_viewportUpdated();
@@ -122,7 +122,7 @@
 void QTouchWebView::touchEvent(QTouchEvent* event)
 {
     forceActiveFocus();
-    QSGItem::touchEvent(event);
+    QQuickItem::touchEvent(event);
 }
 
 void QTouchWebView::onVisibleChanged()

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.h (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebview.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -23,7 +23,7 @@
 
 #include "qwebkitglobal.h"
 
-#include <QtDeclarative/qsgitem.h>
+#include <QtDeclarative/qquickitem.h>
 
 class QTouchEvent;
 class QTouchWebPage;
@@ -33,13 +33,13 @@
 class QtTouchViewInterface;
 }
 
-class QWEBKIT_EXPORT QTouchWebView : public QSGItem
+class QWEBKIT_EXPORT QTouchWebView : public QQuickItem
 {
     Q_OBJECT
     Q_PROPERTY(QTouchWebPage* page READ page CONSTANT FINAL)
 
 public:
-    QTouchWebView(QSGItem* parent = 0);
+    QTouchWebView(QQuickItem* parent = 0);
     ~QTouchWebView();
 
     QTouchWebPage *page();

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/testwindow.h (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/testwindow.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/testwindow.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -22,20 +22,20 @@
 
 #include <QResizeEvent>
 #include <QScopedPointer>
-#include <QtDeclarative/qsgview.h>
-#include <QtDeclarative/qsgitem.h>
+#include <QtDeclarative/qquickitem.h>
+#include <QtDeclarative/qquickview.h>
 
 // TestWindow: Utility class to ignore QGraphicsView details.
-class TestWindow : public QSGView {
+class TestWindow : public QQuickView {
 public:
-    inline TestWindow(QSGItem* webView);
-    QScopedPointer<QSGItem> webView;
+    inline TestWindow(QQuickItem* webView);
+    QScopedPointer<QQuickItem> webView;
 
 protected:
     inline void resizeEvent(QResizeEvent*);
 };
 
-inline TestWindow::TestWindow(QSGItem* webView)
+inline TestWindow::TestWindow(QQuickItem* webView)
     : webView(webView)
 {
     Q_ASSERT(webView);
@@ -44,7 +44,7 @@
 
 inline void TestWindow::resizeEvent(QResizeEvent* event)
 {
-    QSGCanvas::resizeEvent(event);
+    QQuickView::resizeEvent(event);
     webView->setX(0);
     webView->setY(0);
     webView->setWidth(event->size().width());

Modified: trunk/Source/WebKit2/UIProcess/qt/QtDesktopWebPageProxy.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/QtDesktopWebPageProxy.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/QtDesktopWebPageProxy.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -86,7 +86,7 @@
 
 PassRefPtr<WebPopupMenuProxy> QtDesktopWebPageProxy::createPopupMenuProxy(WebPageProxy*)
 {
-    QSGItem* webViewItem = static_cast<QDesktopWebViewPrivate*>(m_viewInterface)->q;
+    QQuickItem* webViewItem = static_cast<QDesktopWebViewPrivate*>(m_viewInterface)->q;
     return WebPopupMenuProxyQtDesktop::create(m_webPageProxy.get(), webViewItem);
 }
 

Modified: trunk/Source/WebKit2/UIProcess/qt/QtSGUpdateQueue.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/QtSGUpdateQueue.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/QtSGUpdateQueue.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -23,7 +23,7 @@
 
 #include "PassOwnPtr.h"
 #include "QtSGTileNode.h"
-#include <QSGItem>
+#include <QQuickItem>
 
 namespace WebKit {
 
@@ -65,7 +65,7 @@
     { }
 };
 
-QtSGUpdateQueue::QtSGUpdateQueue(QSGItem* item)
+QtSGUpdateQueue::QtSGUpdateQueue(QQuickItem *item)
     : item(item)
     , lastScale(0)
     , lastScaleNode(0)

Modified: trunk/Source/WebKit2/UIProcess/qt/QtSGUpdateQueue.h (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/QtSGUpdateQueue.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/QtSGUpdateQueue.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -27,7 +27,7 @@
 
 class QImage;
 class QRect;
-class QSGItem;
+class QQuickItem;
 class QSGNode;
 class QSize;
 
@@ -40,21 +40,21 @@
 // Takes care of taking update requests then fulfilling them asynchronously on the scene graph thread.
 class QtSGUpdateQueue {
 public:
-    QtSGUpdateQueue(QSGItem*);
+    QtSGUpdateQueue(QQuickItem*);
 
     int createTileNode(float scale);
     void removeTileNode(int nodeID);
     void setNodeBackBuffer(int nodeID, const QImage& texture, const QRect& sourceRect, const QRect& targetRect);
     void swapTileBuffers();
 
-    // Called by the QSGItem.
+    // Called by the QQuickItem.
     void applyUpdates(QSGNode* itemNode);
     bool isSwapPending() const { return m_isSwapPending; }
 
 private:
     QSGNode* getScaleNode(float scale, QSGNode* itemNode);
 
-    QSGItem* item;
+    QQuickItem* item;
     Deque<OwnPtr<NodeUpdate> > nodeUpdateQueue;
     HashMap<int, QtSGTileNode*> nodes;
     float lastScale;

Modified: trunk/Source/WebKit2/UIProcess/qt/QtTouchViewInterface.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/QtTouchViewInterface.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/QtTouchViewInterface.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -28,7 +28,7 @@
 #include "qtouchwebview_p.h"
 
 #include <QDeclarativeEngine>
-#include <QSGView>
+#include <QQuickView>
 
 namespace WebKit {
 
@@ -181,7 +181,7 @@
 
 QJSEngine* QtTouchViewInterface::engine()
 {
-    QSGView* view = qobject_cast<QSGView*>(m_pageView->canvas());
+    QQuickView* view = qobject_cast<QQuickView*>(m_pageView->canvas());
     if (view)
         return view->engine();
     return 0;

Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -27,13 +27,13 @@
 #include <QScrollEvent>
 #include <QScrollPrepareEvent>
 #include <QScrollerProperties>
-#include <QtDeclarative/qsgitem.h>
+#include <QtDeclarative/qquickitem.h>
 
 namespace WebKit {
 
 static const int kScaleAnimationDurationMillis = 400;
 
-static inline QRectF contentRectInViewportCoordinates(const QSGItem* content, const QSGItem* viewport)
+static inline QRectF contentRectInViewportCoordinates(const QQuickItem* content, const QQuickItem* viewport)
 {
     return viewport->mapRectFromItem(content, content->boundingRect());
 }
@@ -87,7 +87,7 @@
     const qreal previousScale;
 };
 
-QtViewportInteractionEngine::QtViewportInteractionEngine(const QSGItem* viewport, QSGItem* content)
+QtViewportInteractionEngine::QtViewportInteractionEngine(const QQuickItem* viewport, QQuickItem* content)
     : m_viewport(viewport)
     , m_content(content)
     , m_pendingUpdates(0)

Modified: trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -31,7 +31,7 @@
 
 QT_BEGIN_NAMESPACE
 class QPointF;
-class QSGItem;
+class QQuickItem;
 QT_END_NAMESPACE
 
 namespace WebKit {
@@ -42,7 +42,7 @@
     Q_OBJECT
 
 public:
-    QtViewportInteractionEngine(const QSGItem*, QSGItem*);
+    QtViewportInteractionEngine(const QQuickItem *, QQuickItem *);
     ~QtViewportInteractionEngine();
 
 
@@ -98,8 +98,8 @@
 
     friend class ViewportUpdateGuard;
 
-    const QSGItem* const m_viewport;
-    QSGItem* const m_content;
+    const QQuickItem* const m_viewport;
+    QQuickItem* const m_content;
 
     Constraints m_constraints;
     int m_pendingUpdates;

Modified: trunk/Source/WebKit2/UIProcess/qt/WebContextQt.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/WebContextQt.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/WebContextQt.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -36,7 +36,7 @@
 #include "WebProcessCreationParameters.h"
 
 #include <QCoreApplication>
-#include <QDesktopServices>
+#include <QStandardPaths>
 #include <QDir>
 #include <QProcess>
 
@@ -49,7 +49,7 @@
     if (!s_dataLocation.isEmpty())
         return s_dataLocation;
 
-    QString dataLocation = QDesktopServices::storageLocation(QDesktopServices::DataLocation);
+    QString dataLocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
     if (dataLocation.isEmpty())
         dataLocation = WebCore::pathByAppendingComponent(QDir::homePath(), QCoreApplication::applicationName());
     s_dataLocation = WebCore::pathByAppendingComponent(dataLocation, ".QtWebKit/");

Modified: trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -28,15 +28,15 @@
 
 #include "PlatformPopupMenuData.h"
 #include "WebPopupItem.h"
-#include <QtDeclarative/QSGCanvas>
-#include <QtDeclarative/QSGItem>
+#include <QtDeclarative/QQuickCanvas>
+#include <QtDeclarative/QQuickItem>
 #include <QStandardItemModel>
 
 using namespace WebCore;
 
 namespace WebKit {
 
-WebPopupMenuProxyQtDesktop::WebPopupMenuProxyQtDesktop(WebPopupMenuProxy::Client* client, QSGItem* webViewItem)
+WebPopupMenuProxyQtDesktop::WebPopupMenuProxyQtDesktop(WebPopupMenuProxy::Client* client, QQuickItem* webViewItem)
     : QObject()
     , WebPopupMenuProxy(client)
     , m_comboBox(new QtWebComboBox)

Modified: trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.h (98720 => 98721)


--- trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Source/WebKit2/UIProcess/qt/WebPopupMenuProxyQtDesktop.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -31,7 +31,7 @@
 #include <QtCore/QObject>
 #include <QtCore/QWeakPointer>
 
-class QSGItem;
+class QQuickItem;
 
 namespace WebCore {
 class QtWebComboBox;
@@ -45,7 +45,7 @@
 public:
     virtual ~WebPopupMenuProxyQtDesktop();
 
-    static PassRefPtr<WebPopupMenuProxyQtDesktop> create(WebPopupMenuProxy::Client* client, QSGItem* webViewItem)
+    static PassRefPtr<WebPopupMenuProxyQtDesktop> create(WebPopupMenuProxy::Client* client, QQuickItem* webViewItem)
     {
         return adoptRef(new WebPopupMenuProxyQtDesktop(client, webViewItem));
     }
@@ -58,13 +58,13 @@
     void onPopupMenuHidden();
 
 private:
-    WebPopupMenuProxyQtDesktop(WebPopupMenuProxy::Client*, QSGItem* webViewItem);
+    WebPopupMenuProxyQtDesktop(WebPopupMenuProxy::Client*, QQuickItem* webViewItem);
     void populate(const Vector<WebPopupItem>&);
 
     // Qt guarded pointer because QWidgets have their own memory management and
     // when closing the UI the combobox will be deleted before we are.
     QWeakPointer<WebCore::QtWebComboBox> m_comboBox;
-    QSGItem* m_webViewItem;
+    QQuickItem* m_webViewItem;
     int32_t m_selectedIndex;
 };
 

Modified: trunk/Tools/ChangeLog (98720 => 98721)


--- trunk/Tools/ChangeLog	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Tools/ChangeLog	2011-10-28 13:06:34 UTC (rev 98721)
@@ -1,3 +1,25 @@
+2011-10-28  Simon Hausmann  <[email protected]>
+
+        [Qt] Adapt to QSG* to QQuick* API change in qtdeclarative
+        https://bugs.webkit.org/show_bug.cgi?id=70494
+
+        Reviewed by Kenneth Christiansen.
+
+        Use QQuick* instead of QSG* as well as QStandardPaths
+        instead of QDesktopLocation.
+
+        * MiniBrowser/qt/BrowserWindow.cpp:
+        (BrowserWindow::BrowserWindow):
+        * MiniBrowser/qt/BrowserWindow.h:
+        * QtTestBrowser/cookiejar.cpp:
+        (TestBrowserCookieJar::TestBrowserCookieJar):
+        * QtTestBrowser/launcherwindow.cpp:
+        (LauncherWindow::setDiskCache):
+        * WebKitTestRunner/PlatformWebView.h:
+        * WebKitTestRunner/qt/PlatformWebViewQt.cpp:
+        (WTR::WrapperWindow::WrapperWindow):
+        (WTR::WrapperWindow::handleStatusChanged):
+
 2011-10-28  Jocelyn Turcotte  <[email protected]>
 
         [Qt] Fix the Ctrl behavior for touch mocking in MiniBrowser.

Modified: trunk/Tools/MiniBrowser/qt/BrowserWindow.cpp (98720 => 98721)


--- trunk/Tools/MiniBrowser/qt/BrowserWindow.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Tools/MiniBrowser/qt/BrowserWindow.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -40,7 +40,7 @@
 {
     setWindowTitle("MiniBrowser");
     setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
-    setResizeMode(QSGView::SizeRootObjectToView);
+    setResizeMode(QQuickView::SizeRootObjectToView);
 
     // This allows starting MiniBrowser from the build directory without previously defining QML_IMPORT_PATH.
     QDir qmlImportDir = QDir(QCoreApplication::applicationDirPath());

Modified: trunk/Tools/MiniBrowser/qt/BrowserWindow.h (98720 => 98721)


--- trunk/Tools/MiniBrowser/qt/BrowserWindow.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Tools/MiniBrowser/qt/BrowserWindow.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -31,9 +31,9 @@
 
 #include "MiniBrowserApplication.h"
 #include <QStringList>
-#include <QtDeclarative/QSGView>
+#include <QtDeclarative/QQuickView>
 
-class BrowserWindow : public QSGView {
+class BrowserWindow : public QQuickView {
     Q_OBJECT
 
 public:

Modified: trunk/Tools/QtTestBrowser/cookiejar.cpp (98720 => 98721)


--- trunk/Tools/QtTestBrowser/cookiejar.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Tools/QtTestBrowser/cookiejar.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -27,7 +27,11 @@
 
 #include "cookiejar.h"
 
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include <QStandardPaths>
+#else
 #include <QDesktopServices>
+#endif
 #include <QDir>
 #include <QTextStream>
 
@@ -42,7 +46,11 @@
     connect(&m_timer, SIGNAL(timeout()), this, SLOT(saveToDisk()));
 
 #ifndef QT_NO_DESKTOPSERVICES
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+    QString path = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+#else
     QString path = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
+#endif
 #else
     QString path = QDir::homePath() + "/.QtTestBrowser";
 #endif

Modified: trunk/Tools/QtTestBrowser/launcherwindow.cpp (98720 => 98721)


--- trunk/Tools/QtTestBrowser/launcherwindow.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Tools/QtTestBrowser/launcherwindow.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -64,7 +64,11 @@
 #endif
 
 #if !defined(QT_NO_NETWORKDISKCACHE) && !defined(QT_NO_DESKTOPSERVICES)
-#include <QtGui/QDesktopServices>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+#include <QStandardPaths>
+#else
+#include <QDesktopServices>
+#endif
 #include <QtNetwork/QNetworkDiskCache>
 #endif
 
@@ -845,7 +849,11 @@
     QNetworkDiskCache* cache = 0;
     if (enable) {
         cache = new QNetworkDiskCache();
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
+        QString cacheLocation = QStandardPaths::writableLocation(QStandardPaths::CacheLocation);
+#else
         QString cacheLocation = QDesktopServices::storageLocation(QDesktopServices::CacheLocation);
+#endif
         cache->setCacheDirectory(cacheLocation);
     }
     page()->networkAccessManager()->setCache(cache);

Modified: trunk/Tools/WebKitTestRunner/PlatformWebView.h (98720 => 98721)


--- trunk/Tools/WebKitTestRunner/PlatformWebView.h	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Tools/WebKitTestRunner/PlatformWebView.h	2011-10-28 13:06:34 UTC (rev 98721)
@@ -31,8 +31,8 @@
 #if defined(BUILDING_QT__)
 class QDesktopWebView;
 typedef QDesktopWebView* PlatformWKView;
-class QSGView;
-typedef QSGView* PlatformWindow;
+class QQuickView;
+typedef QQuickView* PlatformWindow;
 #elif defined(__APPLE__) && __APPLE__
 #if __OBJC__
 @class WKView;

Modified: trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp (98720 => 98721)


--- trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp	2011-10-28 12:37:55 UTC (rev 98720)
+++ trunk/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp	2011-10-28 13:06:34 UTC (rev 98721)
@@ -31,28 +31,28 @@
 
 #include <QApplication>
 #include <QDeclarativeProperty>
-#include <QSGView>
+#include <QQuickView>
 
 namespace WTR {
 
-class WrapperWindow : public QSGView {
+class WrapperWindow : public QQuickView {
     Q_OBJECT
 public:
-    WrapperWindow(QSGItem* view)
-        : QSGView(QUrl("data:text/plain,import QtQuick 2.0\nItem { objectName: 'root' }"))
+    WrapperWindow(QQuickItem* view)
+        : QQuickView(QUrl("data:text/plain,import QtQuick 2.0\nItem { objectName: 'root' }"))
         , m_view(view)
     {
-        connect(this, SIGNAL(statusChanged(QSGView::Status)), SLOT(handleStatusChanged(QSGView::Status)));
+        connect(this, SIGNAL(statusChanged(QQuickView::Status)), SLOT(handleStatusChanged(QQuickView::Status)));
     }
 
 private slots:
-    void handleStatusChanged(QSGView::Status status)
+    void handleStatusChanged(QQuickView::Status status)
     {
-        if (status != QSGView::Ready)
+        if (status != QQuickView::Ready)
             return;
 
         setGeometry(0, 0, 800, 600);
-        setResizeMode(QSGView::SizeRootObjectToView);
+        setResizeMode(QQuickView::SizeRootObjectToView);
 
         m_view->setParentItem(rootObject());
         QDeclarativeProperty::write(m_view, "anchors.fill", qVariantFromValue(rootObject()));
@@ -63,7 +63,7 @@
     }
 
 private:
-    QSGItem* m_view;
+    QQuickItem* m_view;
 };
 
 PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to