[WebKit-devel] Re: kwebkitpart.cpp patch (setUrl)

Dawit A adawit at kde.org
Tue Sep 28 06:23:24 CEST 2010


That would be fine...

On Mon, Sep 27, 2010 at 8:23 PM, David Faure <faure at kde.org> wrote:
> Currently kwebkitpart sets the URL in KParts::ReadOnlyPart a bit too late
> (after calling loadUrl), which leads to the started() signal (from ReadOnlyPart) being emitted while the url is still not set
> in the part.
>
> This confuses konq plugins such as uachanger and babelfish, because in slotStarted they expect to see the part URL.
>
> Does this patch seem OK to you?
>
> Index: kwebkitpart.cpp
> ===================================================================
> --- kwebkitpart.cpp     (revision 1179116)
> +++ kwebkitpart.cpp     (working copy)
> @@ -147,6 +147,7 @@
>
>     // Ignore about:blank urls...
>     if (u.url() == "about:blank") {
> +        setUrl(u);
>         emit setWindowCaption (u.url());
>         emit completed();
>     } else {
> @@ -196,11 +197,11 @@
>         // Update the part's OpenUrlArguments after removing all of the
>         // 'kwebkitpart-restore-x' metadata entries...
>         setArguments(args);
> +        // Set URL in KParts before emitting started; konq plugins rely on that.
> +        setUrl(u);
>         d->webView->loadUrl(u, args, bargs);
>     }
>
> -    // Set the url...
> -    setUrl(u);
>     return true;
>  }
>
>
>
> --
> David Faure, faure at kde.org, http://www.davidfaure.fr
> Sponsored by Nokia to work on KDE, incl. Konqueror (http://www.konqueror.org).
> _______________________________________________
> WebKit-devel mailing list
> WebKit-devel at kde.org
> https://mail.kde.org/mailman/listinfo/webkit-devel
>


More information about the WebKit-devel mailing list