summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-09-03 02:39:29 +0200
committerAndrea Diamantini <adjam7@gmail.com>2009-09-03 02:39:29 +0200
commit60d76a0828b388d76e899b70b827171294e72121 (patch)
treee80343e340597a7b6b9bf61c888a95366ebefcda /src
parentImproved a bit "Save As" slot (diff)
downloadrekonq-60d76a0828b388d76e899b70b827171294e72121.tar.xz
User attributes
Diffstat (limited to 'src')
-rw-r--r--src/networkaccessmanager.cpp26
-rw-r--r--src/networkaccessmanager.h4
2 files changed, 19 insertions, 11 deletions
diff --git a/src/networkaccessmanager.cpp b/src/networkaccessmanager.cpp
index c19cf508..b2958d9e 100644
--- a/src/networkaccessmanager.cpp
+++ b/src/networkaccessmanager.cpp
@@ -210,12 +210,20 @@ KIO::MetaData& NetworkAccessManager::metaData()
};
-// QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData)
-// {
-// // FIXME: rude hack. Waiting for a real POST behaviour fix ;)
-// if(op == PostOperation)
-// {
-// return QNetworkAccessManager::createRequest(op,req,outgoingData);
-// }
-// return AccessManager::createRequest(op,req,outgoingData);
-// }
+QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData)
+{
+ // TODO implement Ad-Block here (refuse connections..)
+
+ QNetworkRequest request(req);
+
+ KIO::MetaData metaData(m_metaData);
+
+ QVariant attr = req.attribute(QNetworkRequest::User);
+ if (attr.isValid() && attr.type() == QVariant::Map)
+ {
+ metaData += attr.toMap();
+ }
+ request.setAttribute(QNetworkRequest::User, metaData.toVariant());
+
+ return AccessManager::createRequest(op,request,outgoingData);
+}
diff --git a/src/networkaccessmanager.h b/src/networkaccessmanager.h
index 7297262d..45a3e9f9 100644
--- a/src/networkaccessmanager.h
+++ b/src/networkaccessmanager.h
@@ -50,8 +50,8 @@ public:
public slots:
void loadSettings();
-// protected:
-// virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0);
+protected:
+ virtual QNetworkReply *createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData = 0);
private slots:
void authenticationRequired(QNetworkReply *reply, QAuthenticator *auth);