MailCommon::FolderCollectionMonitor Class

class MailCommon::FolderCollectionMonitor

The FolderCollectionMonitor class. More...

Header: #include <MailCommon/FolderCollectionMonitor>
CMake: find_package(KPim6MailCommon REQUIRED)
target_link_libraries(mytarget PRIVATE KPim6::MailCommon)
Inherits: QObject

Public Functions

FolderCollectionMonitor(Akonadi::Session *session, QObject *parent = nullptr)
virtual ~FolderCollectionMonitor() override
void expireAllFolders(bool immediate, QAbstractItemModel *collectionModel)
void expunge(const Akonadi::Collection &collection, bool sync = false)
Akonadi::ChangeRecorder *monitor() const

Protected Functions

void expireAllCollection(const QAbstractItemModel *model, bool immediate, const QModelIndex &parentIndex = QModelIndex())

Detailed Description

Author: Laurent Montel <montel@kde.org>

Member Function Documentation

[explicit] FolderCollectionMonitor::FolderCollectionMonitor(Akonadi::Session *session, QObject *parent = nullptr)

Constructs a folder collection monitor using the Akonadi session, with the given parent.

[override virtual noexcept] FolderCollectionMonitor::~FolderCollectionMonitor()

Destroys the folder collection monitor.

[protected] void FolderCollectionMonitor::expireAllCollection(const QAbstractItemModel *model, bool immediate, const QModelIndex &parentIndex = QModelIndex())

Expires the old messages of the collections of model under parentIndex, recursively. If immediate is true, the expiry is done immediately.

void FolderCollectionMonitor::expireAllFolders(bool immediate, QAbstractItemModel *collectionModel)

Expires the old messages of all the collections of collectionModel that have auto-expiry enabled. If immediate is true, the expiry is done immediately.

void FolderCollectionMonitor::expunge(const Akonadi::Collection &collection, bool sync = false)

Deletes all the items of the collection collection. If sync is true, the deletion is done synchronously.

Akonadi::ChangeRecorder *FolderCollectionMonitor::monitor() const

Returns the change recorder used to monitor the collections.