summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Chauvin <megabigbug@yahoo.fr>2009-08-10 23:31:11 +0200
committerLionel Chauvin <megabigbug@yahoo.fr>2009-08-10 23:31:11 +0200
commitc04747a9490d39e97c7800a8b19fda40654970f3 (patch)
tree19afa48b70d24bbbd60ba7d53d98f95ee93b3929
parentbetter handle network errors (diff)
downloadrekonq-c04747a9490d39e97c7800a8b19fda40654970f3.tar.xz
prevent icon loading when error page
-rw-r--r--src/webpage.cpp6
-rw-r--r--src/webpage.h5
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