38bool QNetworkAccessCacheBackend::sendCacheContents()
68 if (redirectionTarget.isValid()) {
77 device = nc->data(
url());
84#if defined(QNETWORKACCESSCACHEBACKEND_DEBUG)
85 qDebug() <<
"Successfully sent cache:" <<
url();
The QAbstractNetworkCache class provides the interface for cache implementations.
static QString translate(const char *context, const char *key, const char *disambiguation=nullptr, int n=-1)
\threadsafe
T value(const Key &key) const noexcept
virtual qint64 bytesAvailable() const
Returns the number of bytes that are available for reading.
qint64 read(char *data, qint64 maxlen)
Reads at most maxSize bytes from the device into data, and returns the number of bytes read.
QNetworkAccessBackend is the base class for implementing support for schemes used by QNetworkAccessMa...
QHttpHeaders headers() const
QNetworkAccessManager::Operation operation() const
Returns the operation which was requested when calling QNetworkAccessManager.
void readyRead()
Call this slot when you have more data available to notify the backend that we can attempt to read ag...
void finished()
Call this slot when there will be no more data available, regardless of whether the transfer was succ...
void redirectionRequested(const QUrl &destination)
Call this slot if, when connecting to the resource, a redirect to destination was requested.
void setHeaders(const QHttpHeaders &newHeaders)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QAbstractNetworkCache * networkCache() const
Returns the network cache object that was available when the request was started.
QUrl url() const
Returns the current URL of the reply.
TargetType
Use the values in this enum to specify what type of target the plugin supports.
void metaDataChanged()
Call this slot, if appropriate, after having processed and updated metadata (e.g.
void setCachingEnabled(bool canCache)
If canCache is true then this hints to us that we can cache the reply that is created.
void setAttribute(QNetworkRequest::Attribute attribute, const QVariant &value)
Set attribute to value.
bool start() override
Prepares the backend and calls open().
void close() override
You must implement this function in your derived class.
void open() override
You must implement this in your derived class.
~QNetworkAccessCacheBackend()
qint64 bytesAvailable() const override
You must implement this function in your derived class.
QNetworkAccessCacheBackend()
qint64 read(char *data, qint64 maxlen) override
Implement this function to support reading from the resource made available by your plugin.
@ SourceIsFromCacheAttribute
@ HttpStatusCodeAttribute
@ RedirectionTargetAttribute
@ HttpReasonPhraseAttribute
void setParent(QObject *parent)
Makes the object a child of parent.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Combined button and popup list for selecting options.
DBusConnection const char DBusError * error
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
char * toString(const MyType &t)
[31]