diff options
-rw-r--r-- | src/webpage.cpp | 6 | ||||
-rw-r--r-- | src/webpage.h | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index 6dd3286c..c91b9471 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -72,6 +72,7 @@ WebPage::WebPage(QObject *parent) : QWebPage(parent) , m_keyboardModifiers(Qt::NoModifier) , m_pressedButtons(Qt::NoButton) + , m_requestedUrl("") { setForwardUnsupportedContent(true); @@ -85,6 +86,8 @@ WebPage::WebPage(QObject *parent) bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) { + m_requestedUrl = request.url(); + if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton) { Application::instance()->loadUrl(request.url(), Rekonq::SettingOpenTab); @@ -155,6 +158,9 @@ void WebPage::slotHandleUnsupportedContent(QNetworkReply *reply) void WebPage::manageNetworkErrors(QNetworkReply* reply) { + if (reply->url() != m_requestedUrl) //prevent favicon loading + return; + switch (reply->error()) { case QNetworkReply::NoError: diff --git a/src/webpage.h b/src/webpage.h index 5adad291..a8efb95a 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -36,11 +36,12 @@ // Qt Includes #include <QWebPage> +#include <QUrl> // Forward Declarations class QWebFrame; class QNetworkReply; - +class QUrl; class WebPage : public QWebPage { @@ -89,6 +90,8 @@ private: // keyboard/mouse modifiers Qt::KeyboardModifiers m_keyboardModifiers; Qt::MouseButtons m_pressedButtons; + + QUrl m_requestedUrl; }; #endif |