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

David Faure faure at kde.org
Tue Sep 28 02:23:33 CEST 2010


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).


More information about the WebKit-devel mailing list