Commit 2b2f22ce authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Coding style

parent 1f22688d
......@@ -46,7 +46,10 @@ public:
void archiveFolder(const QString &path, Akonadi::Collection::Id collectionId);
ArchiveMailKernel *kernel() const { return mArchiveMailKernel; }
ArchiveMailKernel *kernel() const
{
return mArchiveMailKernel;
}
public Q_SLOTS:
void load();
......
......@@ -23,7 +23,6 @@
#include "archivemailkernel.h"
#include "archivemailagent_debug.h"
#include <MailCommon/MailUtil>
#include <MailCommon/BackupJob>
......
......@@ -351,7 +351,7 @@ void FilterManager::readConfig()
for (auto i = d->mFilters.cbegin(), e = d->mFilters.cend();
i != e && (!d->mInboundFiltersExist || !d->mAllFoldersFiltersExist);
++i) {
++i) {
if ((*i)->applyOnInbound()) {
d->mInboundFiltersExist = true;
}
......
......@@ -316,12 +316,16 @@ void MailFilterAgent::filterItems(const QList< qint64 > &itemIds, int filterSet)
void MailFilterAgent::filterCollections(const QList<qint64> &collections, int filterSet)
{
for (qint64 id: collections) {
auto ifj = new Akonadi::ItemFetchJob{ Akonadi::Collection{ id }, this };
auto ifj = new Akonadi::ItemFetchJob{
Akonadi::Collection{
id
}, this
};
ifj->setDeliveryOption(Akonadi::ItemFetchJob::EmitItemsInBatches);
connect(ifj, &Akonadi::ItemFetchJob::itemsReceived,
this, [=](const Akonadi::Item::List &items) {
m_filterManager->applyFilters(items, static_cast<FilterManager::FilterSet>(filterSet));
});
m_filterManager->applyFilters(items, static_cast<FilterManager::FilterSet>(filterSet));
});
}
}
......@@ -342,12 +346,16 @@ void MailFilterAgent::applySpecificFiltersOnCollections(const QList<qint64> &col
const auto requires = MailCommon::SearchRule::CompleteMessage;
for (qint64 id : colIds) {
auto ifj = new Akonadi::ItemFetchJob{ Akonadi::Collection{ id }, this };
auto ifj = new Akonadi::ItemFetchJob{
Akonadi::Collection{
id
}, this
};
ifj->setDeliveryOption(Akonadi::ItemFetchJob::EmitItemsInBatches);
connect(ifj, &Akonadi::ItemFetchJob::itemsReceived,
this, [=](const Akonadi::Item::List &items) {
m_filterManager->applySpecificFilters(items, requires, listFilters);
});
m_filterManager->applySpecificFilters(items, requires, listFilters);
});
}
}
......
......@@ -460,7 +460,6 @@ void AppearancePage::ColorsTab::save()
bool customColors = mCustomColorCheck->isChecked();
MessageCore::MessageCoreSettings::self()->setUseDefaultColors(!customColors);
for (int i = 0; i < numColorNames; ++i) {
const QString configName = QLatin1String(colorNames[i].configName);
if (customColors && configName == QLatin1String("UnreadMessageColor")) {
......
......@@ -31,7 +31,6 @@ using MessageComposer::AliasesExpandJob;
#include <KEmailAddress>
AddressValidationJob::AddressValidationJob(const QString &emailAddresses, QWidget *parentWidget, QObject *parent)
: KJob(parent)
, mEmailAddresses(emailAddresses)
......
......@@ -29,7 +29,6 @@
#include <QUrl>
#include <QDebug>
CreateReplyMessageJob::CreateReplyMessageJob(QObject *parent)
: QObject(parent)
, mMessageFactory(nullptr)
......
......@@ -1432,7 +1432,7 @@ void KMCopyCommand::slotCopyResult(KJob *job)
setResult(Failed);
}
qobject_cast<Akonadi::ItemCopyJob*>(job);
qobject_cast<Akonadi::ItemCopyJob *>(job);
Q_EMIT completed(this);
deleteLater();
......@@ -1494,8 +1494,6 @@ void KMCopyDecryptedCommand::slotAppendResult(KJob *job)
}
}
KMMoveCommand::KMMoveCommand(const Akonadi::Collection &destFolder, const Akonadi::Item::List &msgList, MessageList::Core::MessageItemSetReference ref)
: KMCommand(nullptr, msgList)
, mDestFolder(destFolder)
......
......@@ -516,7 +516,7 @@ private:
Result execute() override;
Akonadi::Collection mDestFolder;
QList<KJob*> mPendingJobs;
QList<KJob *> mPendingJobs;
};
class KMMoveCommand : public KMCommand
......
......@@ -2211,7 +2211,7 @@ void KMMainWidget::slotApplyFilterOnFolder(bool recursive)
{
if (mCurrentCollection.isValid()) {
const Akonadi::Collection::List cols = applyFilterOnCollection(recursive);
QAction *action = qobject_cast<QAction*>(sender());
QAction *action = qobject_cast<QAction *>(sender());
applyFilter(cols, action->property("filter_id").toString());
}
}
......@@ -3349,14 +3349,16 @@ void KMMainWidget::setupActions()
mApplyAllFiltersFolderAction = new QAction(QIcon::fromTheme(QStringLiteral("view-filter")), i18n("Apply All Filters"), this);
actionCollection()->addAction(QStringLiteral("apply_filters_folder"), mApplyAllFiltersFolderAction);
connect(mServerSideSubscription, &QAction::triggered,
this, [this] { slotApplyFiltersOnFolder(/* recursive */ false); });
this, [this] { slotApplyFiltersOnFolder(/* recursive */ false);
});
}
{
mApplyAllFiltersFolderRecursiveAction = new QAction(QIcon::fromTheme(QStringLiteral("view-filter")), i18n("Apply All Filters"), this);
actionCollection()->addAction(QStringLiteral("apply_filters_folder_recursive"), mApplyAllFiltersFolderRecursiveAction);
connect(mServerSideSubscription, &QAction::triggered,
this, [this] { slotApplyFiltersOnFolder(/* recursive */ true); });
this, [this] { slotApplyFiltersOnFolder(/* recursive */ true);
});
}
{
......@@ -3961,8 +3963,8 @@ void KMMainWidget::updateFolderMenu()
}
const bool folderWithContent = mCurrentFolderSettings
&& !mCurrentFolderSettings->isStructural()
&& mCurrentFolderSettings->isValid();
&& !mCurrentFolderSettings->isStructural()
&& mCurrentFolderSettings->isValid();
mFolderMailingListPropertiesAction->setEnabled(folderWithContent
&& !mCurrentFolderSettings->isSystemFolder());
......@@ -4217,14 +4219,16 @@ void KMMainWidget::initializeFilterActions()
filterAction = filterToAction(filter);
actionCollection()->addAction(normalizedName + QStringLiteral("___folder"), filterAction);
connect(filterAction, &QAction::triggered,
this, [this] { slotApplyFilterOnFolder(/* recursive */ false); });
this, [this] { slotApplyFilterOnFolder(/* recursive */ false);
});
mApplyFilterFolderActionsMenu->menu()->addAction(filterAction);
mFilterFolderMenuActions.append(filterAction);
filterAction = filterToAction(filter);
actionCollection()->addAction(normalizedName + QStringLiteral("___folder_recursive"), filterAction);
connect(filterAction, &QAction::triggered,
this, [this] { slotApplyFilterOnFolder(/* recursive */ true); });
this, [this] { slotApplyFilterOnFolder(/* recursive */ true);
});
mApplyFilterFolderRecursiveActionsMenu->menu()->addAction(filterAction);
mFilterFolderMenuRecursiveActions.append(filterAction);
}
......
......@@ -61,7 +61,6 @@ using namespace MessageViewer;
#include <KIO/JobUiDelegate>
#include <Akonadi/Contact/ContactEditorDialog>
#include "kmail_debug.h"
......
......@@ -42,7 +42,7 @@ SummaryView::SummaryView(KontactInterface::Core *core, const QVariantList &)
{
mSyncAction = new KSelectAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18n("Sync All"), this);
actionCollection()->addAction(QStringLiteral("kontact_summary_sync"), mSyncAction);
connect(mSyncAction, QOverload<QAction*>::of(&KSelectAction::triggered), this, &SummaryView::syncAccount);
connect(mSyncAction, QOverload<QAction *>::of(&KSelectAction::triggered), this, &SummaryView::syncAccount);
connect(mSyncAction->menu(), &QMenu::aboutToShow, this, &SummaryView::fillSyncActionSubEntries);
insertSyncAction(mSyncAction);
......
......@@ -51,5 +51,4 @@ QString KMSieveImapPasswordProvider::walletPassword(const QString &identifier)
}
return QString();
}
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