Commit 11b4b597 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt to new api

parent 85c977ef
......@@ -66,7 +66,7 @@ option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets)
set(LIBGRAVATAR_VERSION_LIB "5.11.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.11.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.11.41")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.11.40")
set(MESSAGELIB_LIB_VERSION_LIB "5.11.42")
set(LIBKLEO_LIB_VERSION_LIB "5.11.40")
......
......@@ -79,7 +79,7 @@ public:
bool atLeastOneFilterAppliesTo(const QString &accountId) const;
bool atLeastOneIncomingFilterAppliesTo(const QString &accountId) const;
FilterManager *q;
QList<MailCommon::MailFilter *> mFilters;
QVector<MailCommon::MailFilter *> mFilters;
QMap<QString, SearchRule::RequiredPart> mRequiredParts;
QPixmap pixmapNotification;
SearchRule::RequiredPart mRequiredPartsBasedOnAll;
......@@ -96,7 +96,7 @@ void FilterManager::Private::slotItemsFetchedForFilter(const Akonadi::Item::List
filterSet = static_cast<FilterManager::FilterSet>(q->sender()->property("filterSet").toInt());
}
QList<MailFilter *> listMailFilters;
QVector<MailFilter *> listMailFilters;
if (q->sender()->property("listFilters").isValid()) {
const QStringList listFilters = q->sender()->property("listFilters").toStringList();
//TODO improve it
......@@ -363,8 +363,8 @@ void FilterManager::readConfig()
void FilterManager::mailCollectionRemoved(const Akonadi::Collection &collection)
{
QList<MailCommon::MailFilter *>::const_iterator end(d->mFilters.constEnd());
for (QList<MailCommon::MailFilter *>::const_iterator it = d->mFilters.constBegin();
QVector<MailCommon::MailFilter *>::const_iterator end(d->mFilters.constEnd());
for (QVector<MailCommon::MailFilter *>::const_iterator it = d->mFilters.constBegin();
it != end; ++it) {
(*it)->folderRemoved(collection, Akonadi::Collection());
}
......@@ -372,8 +372,8 @@ void FilterManager::mailCollectionRemoved(const Akonadi::Collection &collection)
void FilterManager::agentRemoved(const QString &identifier)
{
QList<MailCommon::MailFilter *>::const_iterator end(d->mFilters.constEnd());
for (QList<MailCommon::MailFilter *>::const_iterator it = d->mFilters.constBegin();
QVector<MailCommon::MailFilter *>::const_iterator end(d->mFilters.constEnd());
for (QVector<MailCommon::MailFilter *>::const_iterator it = d->mFilters.constBegin();
it != end; ++it) {
(*it)->agentRemoved(identifier);
}
......@@ -506,7 +506,7 @@ bool FilterManager::processContextItem(ItemContext context)
return true;
}
bool FilterManager::process(const QList< MailFilter * > &mailFilters, const Akonadi::Item &item, bool needsFullPayload, FilterManager::FilterSet set, bool account, const QString &accountId)
bool FilterManager::process(const QVector< MailFilter * > &mailFilters, const Akonadi::Item &item, bool needsFullPayload, FilterManager::FilterSet set, bool account, const QString &accountId)
{
if (set == NoSet) {
qCDebug(MAILFILTERAGENT_LOG) << "FilterManager: process() called with not filter set selected";
......@@ -523,11 +523,11 @@ bool FilterManager::process(const QList< MailFilter * > &mailFilters, const Akon
d->beginFiltering(item);
ItemContext context(item, needsFullPayload);
QList<MailCommon::MailFilter *>::const_iterator end(mailFilters.constEnd());
QVector<MailCommon::MailFilter *>::const_iterator end(mailFilters.constEnd());
const bool applyOnOutbound = ((set & Outbound) || (set & BeforeOutbound));
for (QList<MailCommon::MailFilter *>::const_iterator it = mailFilters.constBegin();
for (QVector<MailCommon::MailFilter *>::const_iterator it = mailFilters.constBegin();
!stopIt && it != end; ++it) {
if ((*it)->isEnabled()) {
const bool inboundOk = ((set & Inbound) && (*it)->applyOnInbound());
......
......@@ -96,7 +96,7 @@ public:
*/
bool process(const Akonadi::Item &item, bool needsFullPayload, FilterSet set = Inbound, bool account = false, const QString &accountId = QString());
bool process(const QList<MailCommon::MailFilter *> &mailFilters, const Akonadi::Item &item, bool needsFullPayload, FilterSet set = Inbound, bool account = false, const QString &accountId = QString());
bool process(const QVector<MailCommon::MailFilter *> &mailFilters, const Akonadi::Item &item, bool needsFullPayload, FilterSet set = Inbound, bool account = false, const QString &accountId = QString());
/**
* For ad-hoc filters.
......
......@@ -4233,7 +4233,7 @@ void KMMainWidget::initializeFilterActions()
mApplyFilterFolderRecursiveActionsMenu->menu()->addAction(mApplyAllFiltersFolderRecursiveAction);
bool addedSeparator = false;
const QList<MailFilter *> lstFilters = MailCommon::FilterManager::instance()->filters();
const QVector<MailFilter *> lstFilters = MailCommon::FilterManager::instance()->filters();
for (MailFilter *filter : lstFilters) {
if (!filter->isEmpty() && filter->configureShortcut() && filter->isEnabled()) {
QString filterName = QStringLiteral("Filter %1").arg(filter->name());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment