From 83f36acaf95bdd106665d55ceb8deee794a9d2cf Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Wed, 26 Jun 2013 19:11:40 +0200 Subject: Set URL on initial load just when it comes from main frame Stupid me, I tested one week this patch and then pushed the wrong version. Sorry guys, things happen :( BUG: 321583 --- src/webtab/webpage.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/webtab/webpage.cpp b/src/webtab/webpage.cpp index 6c36b5df..fae67ce6 100644 --- a/src/webtab/webpage.cpp +++ b/src/webtab/webpage.cpp @@ -243,12 +243,19 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r tab->setPart(0, KUrl()); // re-enable the view page } - // reset webpage values - _suggestedFileName.clear(); - _loadingUrl = request.url(); - const bool isMainFrameRequest = (frame == mainFrame()); - + if (isMainFrameRequest) + { + // reset webpage values + _suggestedFileName.clear(); + _loadingUrl = request.url(); + + // Set Page URL: This is needed for 2 reasons. + // 1) WebKit is slot setting url in some case. Having an initial URL set seems snappier ;) + // 2) When WebKit cannot set URL (eg: network down), urlbar URL is NOT set + emit initialUrl(_loadingUrl); + } + if (frame) { if (_protHandler.preHandling(request, frame)) @@ -321,11 +328,6 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r } } - // Set Page URL: This is needed for 2 reasons. - // 1) WebKit is slot setting url in some case. Having an initial URL set seems snappier ;) - // 2) When WebKit cannot set URL (eg: network down), urlbar URL is NOT set - emit initialUrl(_loadingUrl); - return KWebPage::acceptNavigationRequest(frame, request, type); } -- cgit v1.2.1