diff options
author | Panagiotis Papadopoulos <pano_90@gmx.net> | 2010-04-21 13:34:20 +0200 |
---|---|---|
committer | Panagiotis Papadopoulos <pano_90@gmx.net> | 2010-04-21 13:34:20 +0200 |
commit | f9153663cb8210ac4d6e7055838344839b4e19b6 (patch) | |
tree | b70233b32eadfbebff062c0000f007ca2f99d732 /src/networkaccessmanager.cpp | |
parent | Merge branch 'master' of git://gitorious.org/rekonq/mainline into i18n (diff) | |
parent | Nebulon's patch. (diff) | |
download | rekonq-f9153663cb8210ac4d6e7055838344839b4e19b6.tar.xz |
Merge branch 'master' of git://gitorious.org/rekonq/mainline into i18n
Diffstat (limited to 'src/networkaccessmanager.cpp')
-rw-r--r-- | src/networkaccessmanager.cpp | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp index eadbfab3..99337206 100644 --- a/src/networkaccessmanager.cpp +++ b/src/networkaccessmanager.cpp @@ -3,7 +3,8 @@ * This file is a part of the rekonq project * * Copyright (C) 2007-2008 Trolltech ASA. All rights reserved -* Copyright (C) 2008-2009 by Andrea Diamantini <adjam7 at gmail dot com>* +* Copyright (C) 2008-2010 by Andrea Diamantini <adjam7 at gmail dot com> +* * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -31,22 +32,56 @@ // Local Includes #include "application.h" #include "adblockmanager.h" +#include "webpage.h" + +// KDE Includes #include <KDebug> + NetworkAccessManager::NetworkAccessManager(QObject *parent) : AccessManager(parent) + , _parentPage( qobject_cast<WebPage *>(parent) ) { } QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData) { - // Adblock - if (op == QNetworkAccessManager::GetOperation) + QNetworkReply *reply = 0; + + switch(op) { - QNetworkReply *reply = Application::adblockManager()->block(req); + case QNetworkAccessManager::HeadOperation: + kDebug() << "HEAD OPERATION"; +// if(outgoingData) +// { +// QByteArray outgoingDataByteArray = outgoingData->peek(1024 * 1024); +// kDebug() << outgoingDataByteArray; +// } + break; + + case QNetworkAccessManager::GetOperation: + kDebug() << "GET OPERATION"; + reply = Application::adblockManager()->block(req, _parentPage); if (reply) return reply; + break; + + case QNetworkAccessManager::PutOperation: + kDebug() << "PUT OPERATION"; + break; + + case QNetworkAccessManager::PostOperation: + kDebug() << "POST OPERATION"; + break; + + case QNetworkAccessManager::DeleteOperation: + kDebug() << "DELETE OPERATION"; + break; + + default: + kDebug() << "UNKNOWN OPERATION"; + break; } return AccessManager::createRequest(op,req,outgoingData); |