From d9d2c0c13fe330944c4ca1b54a1f46c303037508 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Sun, 13 Jan 2013 23:30:14 +0100 Subject: Do NOT clean up urlbar on page errors --- src/webtab/protocolhandler.cpp | 16 +++++++++++++--- src/webtab/webview.cpp | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'src/webtab') diff --git a/src/webtab/protocolhandler.cpp b/src/webtab/protocolhandler.cpp index c21915f7..69583284 100644 --- a/src/webtab/protocolhandler.cpp +++ b/src/webtab/protocolhandler.cpp @@ -37,6 +37,7 @@ #include "urlbar.h" #include "newtabpage.h" +#include "webwindow.h" // KDE Includes #include @@ -170,6 +171,12 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra NewTabPage p(frame); p.generate(_url); + WebWindow *ww = qobject_cast(_webwin); + if (ww) + { + ww->urlBar()->clear(); + ww->urlBar()->setFocus(); + } return true; } @@ -272,9 +279,12 @@ void ProtocolHandler::showResults(const KFileItemList &list) _frame->setHtml(html); qobject_cast(_frame->page())->setIsOnRekonqPage(true); - // FIXME: how can we handle this? -// _webwin->urlBar()->setQUrl(_url); -// _webwin->view()->setFocus(); + WebWindow *ww = qobject_cast(_webwin); + if (ww) + { + ww->urlBar()->setQUrl(_url); + ww->view()->setFocus(); + } if (_frame->page()->settings()->testAttribute(QWebSettings::PrivateBrowsingEnabled)) return; diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp index 4c6520cd..5913d11e 100644 --- a/src/webtab/webview.cpp +++ b/src/webtab/webview.cpp @@ -166,8 +166,8 @@ void WebView::setPage(WebPage *pg) KWebView::setPage(pg); WebWindow *w = m_parentTab->webWindow(); - if (w && w->window()) - pg->setWindow(w->window()); + if (w) + pg->setWindow(w); } -- cgit v1.2.1