Exemplo n.º 1
0
void QtWebPageLoadClient::dispatchLoadFailed(WKErrorRef error)
{
    int errorCode = WKErrorGetErrorCode(error);
    if (toImpl(error)->platformError().isCancellation() || errorCode == kWKErrorCodeFrameLoadInterruptedByPolicyChange || errorCode == kWKErrorCodePlugInWillHandleLoad) {
        // Make sure that LoadStartedStatus has a counterpart when e.g. requesting a download.
        dispatchLoadSucceeded();
        return;
    }

    QtWebError qtError(error);
    QWebLoadRequest loadRequest(qtError.url(), QQuickWebView::LoadFailedStatus, qtError.description(), static_cast<QQuickWebView::ErrorDomain>(qtError.type()), qtError.errorCode());
    emit m_webView->loadingChanged(&loadRequest);
}
Exemplo n.º 2
0
int QtWebError::errorCode() const
{
    return WKErrorGetErrorCode(error.get());
}