diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-02-22 02:06:06 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-02-22 02:06:06 +0100 |
commit | ab28170bd85aeb12384eef2cd4da1c2b04361259 (patch) | |
tree | 0fa7314c81f3003959de7cad53ea330fbea1b537 | |
parent | rekonq 0.3.94 (diff) | |
download | rekonq-ab28170bd85aeb12384eef2cd4da1c2b04361259.tar.xz |
Fixes 217521 bug and let us save also some memory
(1 QUrl variable for each webpage). It needs testing, obvious, but it
seems working well..
BUG:217521
-rw-r--r-- | src/webpage.cpp | 14 | ||||
-rw-r--r-- | src/webpage.h | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index ce2d5e40..9abc1a0b 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -72,7 +72,7 @@ WebPage::WebPage(QObject *parent) - : KWebPage(parent, KWalletIntegration) + : KWebPage(parent, KWalletIntegration) { setForwardUnsupportedContent(true); @@ -87,9 +87,10 @@ WebPage::WebPage(QObject *parent) // Web Plugin Factory setPluginFactory(new WebPluginFactory(this)); - - connect(networkAccessManager(), SIGNAL(finished(QNetworkReply*)), this, SLOT(manageNetworkErrors(QNetworkReply*))); + // managing errors + connect(manager, SIGNAL(finished(QNetworkReply*)), this, SLOT(manageNetworkErrors(QNetworkReply*))); + // handling load & content connect(this, SIGNAL(unsupportedContent(QNetworkReply *)), this, SLOT(handleUnsupportedContent(QNetworkReply *))); connect(this, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); @@ -121,8 +122,6 @@ bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &r return false; } - m_requestedUrl = request.url(); - return KWebPage::acceptNavigationRequest(frame, request, type); } @@ -218,7 +217,10 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) if( reply->error() == QNetworkReply::ContentAccessDenied ) return; - if( reply->url() != m_requestedUrl ) // prevent favicon loading + // don't bother on elements loading errors: we'll manage just + // main url page ones + WebView *v = qobject_cast<WebView *>(view()); + if( reply->url() != v->url() ) return; if( reply->error() == QNetworkReply::ContentNotFoundError ) diff --git a/src/webpage.h b/src/webpage.h index bbaa0f63..f76fd334 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -77,7 +77,6 @@ private slots: private: QString errorPage(QNetworkReply *); - QUrl m_requestedUrl; ProtocolHandler m_protHandler; }; |