![]() |
Qt 6.x
The Qt SDK
|
#include <qnetworkdiskcache_p.h>
Static Public Member Functions | |
static QString | uniqueFileName (const QUrl &url) |
Given a URL, generates a unique enough filename (and subdirectory) | |
static quint32 | crc32 (const char *data, uint len) |
![]() | |
static bool | removeConnection (Connection *c) |
static QObjectPrivate * | get (QObject *o) |
static const QObjectPrivate * | get (const QObject *o) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiverPrivate, Func2 slot) |
static QMetaObject::Connection | connectImpl (const QObject *sender, int signal_index, const QObject *receiver, void **slot, QtPrivate::QSlotObjectBase *slotObj, int type, const int *types, const QMetaObject *senderMetaObject) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static QMetaObject::Connection | connect (const QObject *sender, int signal_index, const QObject *receiver, QtPrivate::QSlotObjectBase *slotObj, Qt::ConnectionType type) |
static bool | disconnect (const QObject *sender, int signal_index, void **slot) |
static bool | disconnect (const QObject *sender, int signal_index, const QObject *receiver, void **slot) |
Public Attributes | ||
QCacheItem | lastItem | |
QString | cacheDirectory | |
QString | dataDirectory | |
qint64 | maximumCacheSize | |
qint64 | currentCacheSize | |
QHash< QIODevice *, QCacheItem * > | inserting | |
![]() | ||
ExtraData * | extraData | |
QAtomicPointer< QThreadData > | threadData | |
QAtomicPointer< ConnectionData > | connections | |
union { | ||
QObject * currentChildBeingDeleted | ||
QAbstractDeclarativeData * declarativeData | ||
}; | ||
QAtomicPointer< QtSharedPointer::ExternalRefCountData > | sharedRefcount | |
![]() | ||
QObject * | q_ptr | |
QObject * | parent | |
QObjectList | children | |
uint | isWidget: 1 | |
uint | blockSig: 1 | |
uint | wasDeleted: 1 | |
uint | isDeletingChildren: 1 | |
uint | sendChildEvents: 1 | |
uint | receiveChildEvents: 1 | |
uint | isWindow: 1 | |
uint | deleteLaterCalled: 1 | |
uint | isQuickItem: 1 | |
uint | willBeWidget: 1 | |
uint | wasWidget: 1 | |
uint | unused: 21 | |
QAtomicInt | postedEvents | |
QDynamicMetaObjectData * | metaObject | |
QBindingStorage | bindingStorage | |
Additional Inherited Members | |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer< ConnectionData > |
Definition at line 57 of file qnetworkdiskcache_p.h.
|
inline |
Definition at line 60 of file qnetworkdiskcache_p.h.
Generates fully qualified path of cached resource from a URL.
Definition at line 571 of file qnetworkdiskcache.cpp.
References dataDirectory, QUrl::isValid(), uniqueFileName(), and url.
Referenced by storeItem().
void QNetworkDiskCachePrivate::prepareLayout | ( | ) |
Create subdirectories and other housekeeping on the filesystem.
Prevents too many files from being present in any single directory.
Definition at line 217 of file qnetworkdiskcache.cpp.
References dataDirectory, i, QDir::mkdir(), QDir::mkpath(), QString::number(), and str.
bool QNetworkDiskCachePrivate::removeFile | ( | const QString & | file | ) |
Put all of the misc file removing into one function to be extra safe.
Definition at line 299 of file qnetworkdiskcache.cpp.
References CACHE_POSTFIX, currentCacheSize, file, QFileInfo::fileName(), fileName, info, qDebug, QFile::remove(), and QFileInfo::size().
Referenced by QNetworkDiskCache::fileMetaData(), and storeItem().
void QNetworkDiskCachePrivate::storeItem | ( | QCacheItem * | item | ) |
Definition at line 231 of file qnetworkdiskcache.cpp.
References cacheFileName(), QSaveFile::commit(), currentCacheSize, QCacheItem::data, QFileDevice::error(), QFile::exists(), QCacheItem::file, fileName, QIODevice::isOpen(), lastItem, QCacheItem::metaData, QFileDevice::NoError, QSaveFile::open(), Q_ASSERT, qWarning, removeFile(), QCacheItem::reset(), QNetworkCacheMetaData::saveToDisk(), QFileDevice::size(), QNetworkCacheMetaData::url(), QCacheItem::writeCompressedData(), QCacheItem::writeHeader(), and QIODeviceBase::WriteOnly.
Given a URL, generates a unique enough filename (and subdirectory)
Definition at line 552 of file qnetworkdiskcache.cpp.
References at, CACHE_POSTFIX, hash, QCryptographicHash::hash(), QByteArray::left(), QByteArray::number(), QString::number(), QUrl::setFragment(), QUrl::setPassword(), QCryptographicHash::Sha1, QUrl::toEncoded(), and url.
Referenced by cacheFileName(), and QCacheItem::read().
QString QNetworkDiskCachePrivate::cacheDirectory |
Definition at line 74 of file qnetworkdiskcache_p.h.
qint64 QNetworkDiskCachePrivate::currentCacheSize |
Definition at line 77 of file qnetworkdiskcache_p.h.
Referenced by removeFile(), and storeItem().
QString QNetworkDiskCachePrivate::dataDirectory |
Definition at line 75 of file qnetworkdiskcache_p.h.
Referenced by cacheFileName(), and prepareLayout().
QHash<QIODevice*, QCacheItem*> QNetworkDiskCachePrivate::inserting |
Definition at line 79 of file qnetworkdiskcache_p.h.
|
mutable |
Definition at line 73 of file qnetworkdiskcache_p.h.
Referenced by storeItem().
qint64 QNetworkDiskCachePrivate::maximumCacheSize |
Definition at line 76 of file qnetworkdiskcache_p.h.