From 8767b92a1027283562d33de783f9601f66f3d32f Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 7 Jun 2013 01:10:36 +0200 Subject: Fix behavior on unloaded sites - show url - reload with f5 BUG:319924 BUG:312928 --- src/webtab/webview.cpp | 14 ++++++++++++++ src/webtab/webview.h | 13 ++++++++----- 2 files changed, 22 insertions(+), 5 deletions(-) (limited to 'src/webtab') 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 &); @@ -137,11 +145,6 @@ Q_SIGNALS: void openPreviousInHistory(); void openNextInHistory(); -private: - bool checkForAccessKey(QKeyEvent *event); - void showAccessKeys(); - void makeAccessKeyLabel(const QChar &accessKey, const QWebElement &element); - private: QPoint m_clickPos; QWebHitTestResult m_contextMenuHitResult; -- cgit v1.2.1