summaryrefslogtreecommitdiff
path: root/imagenetworkaccessmanager.cpp
blob: ab4509bc92c649b8c0f920f1236cca5062c6973f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <QtNetwork/QNetworkRequest>

#include "imagecache.h"
#include "imagenetworkaccessmanager.h"

ImageNetworkAccessManager::ImageNetworkAccessManager(QObject *parent) :
    QNetworkAccessManager(parent)
{
	setCache(new ImageCache);
}

QNetworkReply * ImageNetworkAccessManager::createRequest(Operation op, const QNetworkRequest &request, QIODevice *outgoingData)
{
	QNetworkRequest new_request(request);
	new_request.setAttribute(QNetworkRequest::CacheLoadControlAttribute,
	                         QNetworkRequest::PreferCache);
	return QNetworkAccessManager::createRequest(op, new_request, outgoingData);
}

QNetworkAccessManager * ImageNetworkAccessManagerFactory::create(QObject *parent)
{
	return new ImageNetworkAccessManager(parent);
}