summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/urlbar/urlbar.cpp6
-rw-r--r--src/webtab/webview.cpp14
-rw-r--r--src/webtab/webview.h13
3 files changed, 28 insertions, 5 deletions
diff --git a/src/urlbar/urlbar.cpp b/src/urlbar/urlbar.cpp
index 0c582c42..e12c5842 100644
--- a/src/urlbar/urlbar.cpp
+++ b/src/urlbar/urlbar.cpp
@@ -179,6 +179,10 @@ void UrlBar::setQUrl(const QUrl& url)
if (url.scheme() == QL1S("rekonq"))
return;
+ // we don't set empty url
+ if (url.isEmpty())
+ return;
+
clearFocus();
// Workaround for KLineEdit bug: incorrectly displaying
@@ -187,6 +191,7 @@ void UrlBar::setQUrl(const QUrl& url)
const QString humanReadableUrl = QString::fromUtf8(
QByteArray::fromPercentEncoding(urlTextData).constData()
);
+
// End workaround
setText(humanReadableUrl);
@@ -204,6 +209,7 @@ void UrlBar::loadRequestedUrl(const KUrl& url, Rekonq::OpenType type)
const QString humanReadableUrl = QString::fromUtf8(
QByteArray::fromPercentEncoding(urlTextData).constData()
);
+
// End workaround
setText(humanReadableUrl);
diff --git a/src/webtab/webview.cpp b/src/webtab/webview.cpp
index 5a4a597b..e9d48f29 100644
--- a/src/webtab/webview.cpp
+++ b/src/webtab/webview.cpp
@@ -151,6 +151,20 @@ void WebView::load(const QNetworkRequest &req, QNetworkAccessManager::Operation
}
+void WebView::reload()
+{
+ // This is needed to reload empty url, eg when network is down and you
+ // tried to load an URL.
+ if (url().isEmpty())
+ {
+ load(page()->loadingUrl());
+ return;
+ }
+
+ KWebView::reload();
+}
+
+
void WebView::loadStarted()
{
hideAccessKeys();
diff --git a/src/webtab/webview.h b/src/webtab/webview.h
index 8f4eb029..bbcd10fd 100644
--- a/src/webtab/webview.h
+++ b/src/webtab/webview.h
@@ -76,6 +76,9 @@ public:
QNetworkAccessManager::Operation op = QNetworkAccessManager::GetOperation,
const QByteArray & body = QByteArray());
+public Q_SLOTS:
+ void reload();
+
protected:
bool popupSpellMenu(QContextMenuEvent *event);
void contextMenuEvent(QContextMenuEvent *event);
@@ -130,6 +133,11 @@ private Q_SLOTS:
void guessHoveredLink(QPoint);
+private:
+ bool checkForAccessKey(QKeyEvent *event);
+ void showAccessKeys();
+ void makeAccessKeyLabel(const QChar &accessKey, const QWebElement &element);
+
Q_SIGNALS:
void loadUrl(const KUrl &, const Rekonq::OpenType &);
@@ -138,11 +146,6 @@ Q_SIGNALS:
void openNextInHistory();
private:
- bool checkForAccessKey(QKeyEvent *event);
- void showAccessKeys();
- void makeAccessKeyLabel(const QChar &accessKey, const QWebElement &element);
-
-private:
QPoint m_clickPos;
QWebHitTestResult m_contextMenuHitResult;