diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2013-01-13 23:30:14 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2013-01-13 23:30:14 +0100 |
commit | d9d2c0c13fe330944c4ca1b54a1f46c303037508 (patch) | |
tree | 81856576388f7f0459b0c6bb6ce2ec1c88af0c7a /src/webtab | |
parent | Make Unlink translatable (diff) | |
download | rekonq-d9d2c0c13fe330944c4ca1b54a1f46c303037508.tar.xz |
Do NOT clean up urlbar on page errors
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); } |