Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp b/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp
- index 51ecbd4..128a097 100644
- --- a/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp
- +++ b/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp
- @@ -24,9 +24,11 @@
- #include <QGraphicsSceneResizeEvent>
- #include <QStyleOptionGraphicsItem>
- +#include <QtDeclarative/qdeclarativeengine.h>
- #include <QtDeclarative/qsgcanvas.h>
- #include <QtDeclarative/qsgevent.h>
- #include <QtDeclarative/qsgitem.h>
- +#include <QtDeclarative/qsgview.h>
- #include <QtGui/QCursor>
- #include <QtGui/QFocusEvent>
- #include <QtGui/QGraphicsSceneEvent>
- @@ -36,6 +38,8 @@
- #include <QtGui/QTouchEvent>
- #include <QtGui/QWheelEvent>
- +#include <QDebug>
- +
- QDesktopWebViewPrivate::QDesktopWebViewPrivate(QDesktopWebView* q, WKContextRef contextRef, WKPageGroupRef pageGroupRef)
- : q(q)
- , page(this, contextRef, pageGroupRef)
- @@ -142,7 +146,14 @@ void QDesktopWebViewPrivate::loadDidSucceed()
- void QDesktopWebViewPrivate::loadDidFail(const QWebError& error)
- {
- - emit q->loadFailed(error);
- + QSGView* view = qobject_cast<QSGView*>(q->canvas());
- + QJSValue value;
- + if (view) {
- + value = view->engine()->newObject();
- + value.setProperty(QLatin1String("errorCode"), true);
- + value.setProperty(QLatin1String("type"), error.type());
- + }
- + emit q->loadFailed(value);
- }
- void QDesktopWebViewPrivate::didChangeLoadProgress(int percentageLoaded)
- diff --git a/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h b/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h
- index 034c216..616d070 100644
- --- a/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h
- +++ b/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h
- @@ -80,7 +80,8 @@ Q_SIGNALS:
- void statusBarMessageChanged(const QString&);
- void loadStarted();
- void loadSucceeded();
- - void loadFailed(const QWebError&);
- + // The parameter needs to be explicitly named to work in QML.
- + void loadFailed(const QJSValue& error);
- void loadProgressChanged(int progress);
- void urlChanged(const QUrl&);
Add Comment
Please, Sign In to add comment