diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-02-29 22:47:35 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-02-29 22:47:35 +0100 |
commit | 6e13caa8a8e6247e5e719d869846fd2d44844dae (patch) | |
tree | eab390ca9f602377543299da72ec020eb9b68aab | |
parent | clean up SSL data retrieve (diff) | |
download | rekonq-6e13caa8a8e6247e5e719d869846fd2d44844dae.tar.xz |
Clean up KIO/AccessManager integration
-rw-r--r-- | src/networkaccessmanager.cpp | 25 | ||||
-rw-r--r-- | src/webpage.cpp | 3 |
2 files changed, 2 insertions, 26 deletions
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 1cfcce42..99233aa1 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -62,37 +62,14 @@ QNetworkReply *NetworkAccessManager::createRequest(QNetworkAccessManager::Operat QNetworkReply *reply = 0; + // set our "nice" accept-language header... QNetworkRequest req = request; - req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); req.setRawHeader("Accept-Language", _acceptLanguage); - KIO::CacheControl cc = KProtocolManager::cacheControl(); - switch (cc) - { - case KIO::CC_CacheOnly: // Fail request if not in cache. - req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysCache); - break; - - case KIO::CC_Refresh: // Always validate cached entry with remote site. - req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferNetwork); - break; - - case KIO::CC_Reload: // Always fetch from remote site - req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); - break; - - case KIO::CC_Cache: // Use cached entry if available. - case KIO::CC_Verify: // Validate cached entry with remote site if expired. - default: - req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); - break; - } - // Handle GET operations with AdBlock if (op == QNetworkAccessManager::GetOperation) reply = rApp->adblockManager()->block(req, parentPage); - if (!reply) reply = AccessManager::createRequest(op, req, outgoingData); diff --git a/src/webpage.cpp b/src/webpage.cpp index a0bb5a6d..f641bebc 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -455,8 +455,7 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply) const QVariant redirectVar = reply->attribute(QNetworkRequest::RedirectionTargetAttribute); if (redirectVar.isValid()) { - _sslInfo.restoreFrom(reply->attribute(static_cast<QNetworkRequest::Attribute>(KIO::AccessManager::MetaData)), - reply->url()); + _sslInfo.restoreFrom(reply->attribute(static_cast<QNetworkRequest::Attribute>(KIO::AccessManager::MetaData)), reply->url()); return; } |