diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-25 02:37:12 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-25 02:37:12 +0200 |
commit | 425a13cba17f271e211b1355d04f697cad2795e8 (patch) | |
tree | 4bcc38fc3d3943088f7835a45d8ef75d8f0e9460 /src/webpage.cpp | |
parent | Various changes (diff) | |
download | rekonq-425a13cba17f271e211b1355d04f697cad2795e8.tar.xz |
Fix error pages show
Diffstat (limited to 'src/webpage.cpp')
-rw-r--r-- | src/webpage.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index b6f26f19..021856f7 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -148,6 +148,8 @@ WebPage::~WebPage() bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type) { + _loadingUrl = request.url(); + KIO::AccessManager *manager = qobject_cast<KIO::AccessManager*>(networkAccessManager()); KIO::MetaData metaData = manager->requestMetaData(); @@ -308,8 +310,13 @@ void WebPage::handleUnsupportedContent(QNetworkReply *reply) } -void WebPage::loadFinished(bool) +void WebPage::loadFinished(bool ok) { + kDebug() << "==========================="; + kDebug() << ok; + kDebug() << mainFrame()->url(); + kDebug() << "==========================="; + Application::adblockManager()->applyHidingRules(this); QStringList list = ReKonfig::walletBlackList(); @@ -327,7 +334,7 @@ void WebPage::loadFinished(bool) void WebPage::manageNetworkErrors(QNetworkReply *reply) { Q_ASSERT(reply); - WebView *v = 0; + QWebFrame* frame = qobject_cast<QWebFrame *>(reply->request().originatingObject()); const bool isMainFrameRequest = (frame == mainFrame()); @@ -355,7 +362,6 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) break; case QNetworkReply::UnknownNetworkError: // unknown network-related error detected - if( _protHandler.postHandling(reply->request(), mainFrame()) ) break; @@ -373,13 +379,8 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) case QNetworkReply::ProtocolUnknownError: // Unknown protocol case QNetworkReply::ProtocolInvalidOperationError: // requested operation is invalid for this protocol - // don't bother on elements loading errors: - // we'll manage just main url page ones - v = qobject_cast<WebView *>(view()); - if( reply->url() != v->url() ) - break; - - mainFrame()->setHtml( errorPage(reply), reply->url() ); + if(reply->url() == _loadingUrl) + mainFrame()->setHtml( errorPage(reply), reply->url() ); break; default: |