KDAV 5.109.0
|
A helper class to cache ETags. More...
#include <KDAV/EtagCache>
Public Member Functions | |
EtagCache (QObject *parent=nullptr) | |
Creates a new ETag cache and populates it with the ETags of items found in collection . | |
QStringList | changedRemoteIds () const |
Returns the list of remote ids of items that have been changed in the backend. | |
bool | contains (const QString &remoteId) const |
Checks if the given item is in the cache. | |
bool | etagChanged (const QString &remoteId, const QString &refEtag) const |
Check if the known ETag for the remote ID is equal to refEtag . | |
bool | isOutOfDate (const QString &remoteId) const |
Returns true if the remote ID is marked as changed (is contained in the return of changedRemoteIds) | |
void | markAsChanged (const QString &remoteId) |
Mark an item as changed in the backend. | |
void | removeEtag (const QString &remoteId) |
Removes the entry for item with remote ID remoteId . | |
void | setEtag (const QString &remoteId, const QString &etag) |
Sets the ETag for the remote ID. | |
QStringList | urls () const |
Returns the list of all items URLs. | |
Protected Member Functions | |
void | setEtagInternal (const QString &remoteId, const QString &etag) |
Sets the ETag for the remote ID. | |
A helper class to cache ETags.
The EtagCache caches the remote ids and ETags of all items in a given collection. This cache is needed to find out which items have been changed in the backend and have to be refetched on the next call of Akonadi::ResourceBase::retrieveItems()
|
explicit |
Creates a new ETag cache and populates it with the ETags of items found in collection
.
QStringList KDAV::EtagCache::changedRemoteIds | ( | ) | const |
Returns the list of remote ids of items that have been changed in the backend.
bool KDAV::EtagCache::contains | ( | const QString & | remoteId | ) | const |
Checks if the given item is in the cache.
bool KDAV::EtagCache::etagChanged | ( | const QString & | remoteId, |
const QString & | refEtag | ||
) | const |
Check if the known ETag for the remote ID is equal to refEtag
.
bool KDAV::EtagCache::isOutOfDate | ( | const QString & | remoteId | ) | const |
Returns true if the remote ID is marked as changed (is contained in the return of changedRemoteIds)
void KDAV::EtagCache::markAsChanged | ( | const QString & | remoteId | ) |
Mark an item as changed in the backend.
void KDAV::EtagCache::removeEtag | ( | const QString & | remoteId | ) |
Removes the entry for item with remote ID remoteId
.
void KDAV::EtagCache::setEtag | ( | const QString & | remoteId, |
const QString & | etag | ||
) |
Sets the ETag for the remote ID.
If the remote ID is marked as changed (is contained in the return of changedRemoteIds), remove it from the changed list.
|
protected |
Sets the ETag for the remote ID.
QStringList KDAV::EtagCache::urls | ( | ) | const |
Returns the list of all items URLs.