[webkit-qt] Page loading status API could be improved

simon.hausmann at nokia.com simon.hausmann at nokia.com
Fri Mar 30 13:46:18 PDT 2012


LoadStoppedStatus makes sense to me. What do the others think?

Simon

--
Sendt fra min Nokia N930.03.12 22:29 skrev ext Marcelo Lira:
Hi all,

In Qt5/WebKit2, when monitoring the loading of a page in a WebView,
before the loading is complete I call WebView.stop(). After stoping,
WebView.loadRequest.status will be set to WebView.LoadFailedStatus.
But this is no error, since the load was intentionally interrupted.

To know if the LoadFailedStatus represents an intentional stop to the
loading process, I have to check also loadRequest.errorCode, as in the
QML code below:

WebView {
    onLoadingChanged: {
        if (loadRequest.status !== WebView.LoadFailedStatus
            || loadRequest.errorCode === NetworkReply.OperationCanceledError)
            return; // Not an error, user stopped the page loading.
        (...)
        // Check for real errors.
    }
}

Checking QQuickWebView I saw these possible load statuses:

enum LoadStatus {
    LoadStartedStatus,
    LoadSucceededStatus,
    LoadFailedStatus
};

It seems to me that a LoadStoppedStatus would make more sense for the
case I'm describing, and also make the checking code simpler.
Does any one agree with this? Should I fill a bug, or leave it be?

Cheers,
Marcelo
_______________________________________________
webkit-qt mailing list
webkit-qt at lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt


More information about the webkit-qt mailing list