diff options
Diffstat (limited to 'src/webtab')
-rw-r--r-- | src/webtab/protocolhandler.cpp | 16 | ||||
-rw-r--r-- | src/webtab/webview.cpp | 4 |
2 files changed, 15 insertions, 5 deletions
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 <KIO/Job> @@ -170,6 +171,12 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra NewTabPage p(frame); p.generate(_url); + WebWindow *ww = qobject_cast<WebWindow *>(_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<WebPage *>(_frame->page())->setIsOnRekonqPage(true); - // FIXME: how can we handle this? -// _webwin->urlBar()->setQUrl(_url); -// _webwin->view()->setFocus(); + WebWindow *ww = qobject_cast<WebWindow *>(_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); } |