summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2013-01-13 23:30:14 +0100
committerAndrea Diamantini <adjam7@gmail.com>2013-01-13 23:30:14 +0100
commitd9d2c0c13fe330944c4ca1b54a1f46c303037508 (patch)
tree81856576388f7f0459b0c6bb6ce2ec1c88af0c7a
parentMake Unlink translatable (diff)
downloadrekonq-d9d2c0c13fe330944c4ca1b54a1f46c303037508.tar.xz
Do NOT clean up urlbar on page errors
-rw-r--r--src/urlbar/urlbar.cpp17
-rw-r--r--src/webtab/protocolhandler.cpp16
-rw-r--r--src/webtab/webview.cpp4
3 files changed, 21 insertions, 16 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 4aeec1b2..947e0910 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -180,17 +180,12 @@ UrlBar::~UrlBar()
void UrlBar::setQUrl(const QUrl& url)
{
if (url.scheme() == QL1S("about"))
- {
- clear();
- setFocus();
- }
- else
- {
- clearFocus();
- KLineEdit::setUrl(url);
- setCursorPosition(0);
- refreshFavicon();
- }
+ return;
+
+ clearFocus();
+ KLineEdit::setUrl(url);
+ setCursorPosition(0);
+ refreshFavicon();
}
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);
}