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

Rafael Brandao rafael.lobo at openbossa.org
Fri Mar 30 16:50:24 PDT 2012


I like the idea, sounds more clear.

On Fri, Mar 30, 2012 at 5:46 PM, <simon.hausmann at nokia.com> wrote:

> 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
> _______________________________________________
> webkit-qt mailing list
> webkit-qt at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-qt
>



-- 
Rafael Brandao @ INdT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20120330/eafb8937/attachment.html>


More information about the webkit-qt mailing list