diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-04-30 11:23:37 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-04-30 11:23:37 +0200 |
commit | c896cc340d7e6e0878b3249c5792e6d88a12cf42 (patch) | |
tree | fd0a7a61ff1d07f301f2188de5cb6fa473134897 /src/networkaccessmanager.cpp | |
parent | A tiny improvement in the error page, showing a fat icon.. :) (diff) | |
download | rekonq-c896cc340d7e6e0878b3249c5792e6d88a12cf42.tar.xz |
A coding style round
Diffstat (limited to 'src/networkaccessmanager.cpp')
-rw-r--r-- | src/networkaccessmanager.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index 15a71317..1d67301b 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -11,9 +11,9 @@ * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved -* by the membership of KDE e.V.), which shall act as a proxy +* by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. -* +* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the @@ -44,39 +44,39 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) - : AccessManager(parent) + : AccessManager(parent) { QString c = KGlobal::locale()->country(); - if(c == QL1S("C")) + if (c == QL1S("C")) c = QL1S("en_US"); - if(c != QL1S("en_US")) - c.append( QL1S(", en_US") ); - + if (c != QL1S("en_US")) + c.append(QL1S(", en_US")); + _acceptLanguage = c.toLatin1(); } QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData) { - WebPage *parentPage = qobject_cast<WebPage *>( parent() ); - + WebPage *parentPage = qobject_cast<WebPage *>(parent()); + QNetworkReply *reply = 0; - + QNetworkRequest req = request; req.setAttribute(QNetworkRequest::HttpPipeliningAllowedAttribute, true); req.setRawHeader("Accept-Language", _acceptLanguage); KIO::CacheControl cc = KProtocolManager::cacheControl(); - switch(cc) + 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; @@ -87,14 +87,14 @@ QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkR req.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache); break; } - - if( op == QNetworkAccessManager::GetOperation ) + + if (op == QNetworkAccessManager::GetOperation) { reply = Application::adblockManager()->block(req, parentPage); if (reply) return reply; } - return AccessManager::createRequest(op,req,outgoingData); + return AccessManager::createRequest(op, req, outgoingData); } |