Commit 4b1d83a9 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: We depend against c++17

parent ef9244e9
Pipeline #68582 passed with stage
in 23 minutes and 11 seconds
......@@ -46,7 +46,7 @@ void ArchiveMailManager::load()
auto info = new ArchiveMailInfo(group);
if (ArchiveMailAgentUtil::needToArchive(info)) {
for (ArchiveMailInfo *oldInfo : qAsConst(mListArchiveInfo)) {
for (ArchiveMailInfo *oldInfo : std::as_const(mListArchiveInfo)) {
if (oldInfo->saveCollectionId() == info->saveCollectionId()) {
// already in jobscheduler
delete info;
......@@ -141,7 +141,7 @@ QString ArchiveMailManager::printCurrentListInfo() const
if (mListArchiveInfo.isEmpty()) {
infoStr = QStringLiteral("No archive in queue");
} else {
for (ArchiveMailInfo *info : qAsConst(mListArchiveInfo)) {
for (ArchiveMailInfo *info : std::as_const(mListArchiveInfo)) {
if (!infoStr.isEmpty()) {
infoStr += QLatin1Char('\n');
}
......
......@@ -115,7 +115,7 @@ void FollowUpReminderManager::checkFollowUp(const Akonadi::Item &item, const Ako
void FollowUpReminderManager::slotCheckFollowUpFinished(const QString &messageId, Akonadi::Item::Id id)
{
for (FollowUpReminderInfo *info : qAsConst(mFollowUpReminderInfoList)) {
for (FollowUpReminderInfo *info : std::as_const(mFollowUpReminderInfoList)) {
qCDebug(FOLLOWUPREMINDERAGENT_LOG) << "FollowUpReminderManager::slotCheckFollowUpFinished info:" << info;
if (!info) {
continue;
......@@ -166,7 +166,7 @@ QString FollowUpReminderManager::printDebugInfo() const
if (mFollowUpReminderInfoList.isEmpty()) {
infoStr = QStringLiteral("No mail");
} else {
for (FollowUpReminder::FollowUpReminderInfo *info : qAsConst(mFollowUpReminderInfoList)) {
for (FollowUpReminder::FollowUpReminderInfo *info : std::as_const(mFollowUpReminderInfoList)) {
if (!infoStr.isEmpty()) {
infoStr += QLatin1Char('\n');
}
......
......@@ -79,7 +79,7 @@ void FilterManager::Private::slotItemsFetchedForFilter(const Akonadi::Item::List
const QStringList listFilters = q->sender()->property("listFilters").toStringList();
// TODO improve it
for (const QString &filterId : listFilters) {
for (MailCommon::MailFilter *filter : qAsConst(mFilters)) {
for (MailCommon::MailFilter *filter : std::as_const(mFilters)) {
if (filter->identifier() == filterId) {
listMailFilters << filter;
break;
......@@ -94,7 +94,7 @@ void FilterManager::Private::slotItemsFetchedForFilter(const Akonadi::Item::List
bool needsFullPayload = q->sender()->property("needsFullPayload").toBool();
for (const Akonadi::Item &item : qAsConst(items)) {
for (const Akonadi::Item &item : std::as_const(items)) {
++mCurrentProgressCount;
if ((mTotalProgressCount > 0) && (mCurrentProgressCount != mTotalProgressCount)) {
......@@ -150,7 +150,7 @@ void FilterManager::Private::itemFetchJobForFilterDone(KJob *job)
// find correct filter object
MailCommon::MailFilter *wantedFilter = nullptr;
for (MailCommon::MailFilter *filter : qAsConst(mFilters)) {
for (MailCommon::MailFilter *filter : std::as_const(mFilters)) {
if (filter->identifier() == filterId) {
wantedFilter = filter;
break;
......@@ -256,7 +256,7 @@ void FilterManager::Private::endFiltering(const Akonadi::Item & /*item*/) const
bool FilterManager::Private::atLeastOneFilterAppliesTo(const QString &accountId) const
{
for (const MailCommon::MailFilter *filter : qAsConst(mFilters)) {
for (const MailCommon::MailFilter *filter : std::as_const(mFilters)) {
if (filter->applyOnAccount(accountId)) {
return true;
}
......@@ -267,7 +267,7 @@ bool FilterManager::Private::atLeastOneFilterAppliesTo(const QString &accountId)
bool FilterManager::Private::atLeastOneIncomingFilterAppliesTo(const QString &accountId) const
{
for (const MailCommon::MailFilter *filter : qAsConst(mFilters)) {
for (const MailCommon::MailFilter *filter : std::as_const(mFilters)) {
if (filter->applyOnInbound() && filter->applyOnAccount(accountId)) {
return true;
}
......@@ -544,7 +544,7 @@ QString FilterManager::createUniqueName(const QString &name) const
while (found) {
found = false;
for (const MailCommon::MailFilter *filter : qAsConst(d->mFilters)) {
for (const MailCommon::MailFilter *filter : std::as_const(d->mFilters)) {
if (!filter->name().compare(uniqueName)) {
found = true;
++counter;
......@@ -568,7 +568,7 @@ MailCommon::SearchRule::RequiredPart FilterManager::requiredPart(const QString &
void FilterManager::dump() const
{
for (const MailCommon::MailFilter *filter : qAsConst(d->mFilters)) {
for (const MailCommon::MailFilter *filter : std::as_const(d->mFilters)) {
qCDebug(MAILFILTERAGENT_LOG) << filter->asString();
}
}
......
......@@ -108,7 +108,7 @@ void SendLaterManager::stopTimer()
MessageComposer::SendLaterInfo *SendLaterManager::searchInfo(Akonadi::Item::Id id)
{
for (MessageComposer::SendLaterInfo *info : qAsConst(mListSendLaterInfo)) {
for (MessageComposer::SendLaterInfo *info : std::as_const(mListSendLaterInfo)) {
if (info->itemId() == id) {
return info;
}
......@@ -229,7 +229,7 @@ QString SendLaterManager::printDebugInfo() const
if (mListSendLaterInfo.isEmpty()) {
infoStr = QStringLiteral("No mail");
} else {
for (MessageComposer::SendLaterInfo *info : qAsConst(mListSendLaterInfo)) {
for (MessageComposer::SendLaterInfo *info : std::as_const(mListSendLaterInfo)) {
if (!infoStr.isEmpty()) {
infoStr += QLatin1Char('\n');
}
......
......@@ -118,12 +118,12 @@ void UnifiedMailbox::attachManager(UnifiedMailboxManager *manager)
if (mManager != manager) {
if (manager) {
// Force that we start monitoring all the collections
for (const auto source : qAsConst(mSources)) {
for (const auto source : std::as_const(mSources)) {
manager->mMonitor.setCollectionMonitored(Akonadi::Collection{source});
manager->mSourceToBoxMap.insert({source, this});
}
} else {
for (const auto &source : qAsConst(mSources)) {
for (const auto &source : std::as_const(mSources)) {
mManager->mMonitor.setCollectionMonitored(Akonadi::Collection{source}, false);
mManager->mSourceToBoxMap.erase(source);
}
......
......@@ -1260,7 +1260,7 @@ void AppearancePage::MessageTagTab::slotTagsFetched(KJob *job)
std::sort(msgTagList.begin(), msgTagList.end(), MailCommon::Tag::compare);
for (const MailCommon::Tag::Ptr &tag : qAsConst(msgTagList)) {
for (const MailCommon::Tag::Ptr &tag : std::as_const(msgTagList)) {
auto newItem = new TagListWidgetItem(QIcon::fromTheme(tag->iconName), tag->tagName, mTagListBox);
newItem->setKMailTag(tag);
if (tag->priority == -1) {
......@@ -1279,7 +1279,7 @@ void AppearancePage::MessageTagTab::slotTagsFetched(KJob *job)
// Save the original list
mOriginalMsgTagList.clear();
for (const MailCommon::TagPtr &tag : qAsConst(msgTagList)) {
for (const MailCommon::TagPtr &tag : std::as_const(msgTagList)) {
mOriginalMsgTagList.append(MailCommon::TagPtr(new MailCommon::Tag(*tag)));
}
}
......
......@@ -148,8 +148,8 @@ void ConfigurePluginsListWidget::save()
void ConfigurePluginsListWidget::saveAkonadiAgent()
{
for (PluginItem *item : qAsConst(mAgentPluginsItems)) {
for (const PimCommon::PluginUtilData &data : qAsConst(mPluginUtilDataList)) {
for (PluginItem *item : std::as_const(mAgentPluginsItems)) {
for (const PimCommon::PluginUtilData &data : std::as_const(mPluginUtilDataList)) {
if (item->mIdentifier == data.mIdentifier) {
changeAgentActiveState(data.mExtraInfo.at(0), data.mExtraInfo.at(1), item->checkState(0) == Qt::Checked);
break;
......@@ -383,7 +383,7 @@ void ConfigurePluginsListWidget::slotConfigureClicked(const QString &groupName,
MessageViewer::MessageViewerConfigureSettingsPluginManager::self()->pluginFromIdentifier(identifier);
plugin->showConfigureDialog(this);
} else if (groupName == agentAkonadiGroupName()) {
for (const PimCommon::PluginUtilData &data : qAsConst(mPluginUtilDataList)) {
for (const PimCommon::PluginUtilData &data : std::as_const(mPluginUtilDataList)) {
if (data.mIdentifier == identifier) {
auto instance = Akonadi::AgentManager::self()->instance(identifier);
if (instance.isValid()) {
......
......@@ -115,7 +115,7 @@ void AttachmentView::keyPressEvent(QKeyEvent *event)
auto part = model()->data(index, MessageComposer::AttachmentModel::AttachmentPartRole).value<AttachmentPart::Ptr>();
toRemove.append(part);
}
for (const AttachmentPart::Ptr &part : qAsConst(toRemove)) {
for (const AttachmentPart::Ptr &part : std::as_const(toRemove)) {
mModel->removeAttachment(part);
}
} else {
......
......@@ -34,7 +34,7 @@ CodecAction::CodecAction(Mode mode, QObject *parent)
removeAllActions();
addAction(oldActions.takeFirst()); // 'Default'
addAction(i18nc("Encodings menu", "us-ascii"));
for (QAction *a : qAsConst(oldActions)) {
for (QAction *a : std::as_const(oldActions)) {
addAction(a);
}
} else if (mode == ReaderMode) {
......
......@@ -51,7 +51,7 @@ void KMailPluginEditorCheckBeforeSendManagerInterface::initializePlugins()
bool KMailPluginEditorCheckBeforeSendManagerInterface::execute(const MessageComposer::PluginEditorCheckBeforeSendParams &params) const
{
for (MessageComposer::PluginEditorCheckBeforeSendInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorCheckBeforeSendInterface *interface : std::as_const(mListPluginInterface)) {
if (!interface->exec(params)) {
return false;
}
......
......@@ -19,14 +19,14 @@ KMailPluginEditorConvertTextManagerInterface::~KMailPluginEditorConvertTextManag
void KMailPluginEditorConvertTextManagerInterface::enableDisablePluginActions(bool richText)
{
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : std::as_const(mListPluginInterface)) {
interface->enableDisablePluginActions(richText);
}
}
void KMailPluginEditorConvertTextManagerInterface::reformatText()
{
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : std::as_const(mListPluginInterface)) {
if (interface->reformatText()) {
// TODO signal that it was reformating.
// Stop it.?
......@@ -40,7 +40,7 @@ KMailPluginEditorConvertTextManagerInterface::convertTextToFormat(MessageCompose
{
MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus status =
MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus::NotConverted;
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : std::as_const(mListPluginInterface)) {
switch (interface->convertTextToFormat(textPart)) {
case MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus::NotConverted:
if (status != MessageComposer::PluginEditorConvertTextInterface::ConvertTextStatus::Converted) {
......@@ -60,14 +60,14 @@ KMailPluginEditorConvertTextManagerInterface::convertTextToFormat(MessageCompose
void KMailPluginEditorConvertTextManagerInterface::setInitialData(const MessageComposer::PluginEditorConverterInitialData &data)
{
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : std::as_const(mListPluginInterface)) {
interface->setInitialData(data);
}
}
void KMailPluginEditorConvertTextManagerInterface::setDataBeforeConvertingText(const MessageComposer::PluginEditorConverterBeforeConvertingData &data)
{
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : std::as_const(mListPluginInterface)) {
interface->setBeforeConvertingData(data);
}
}
......@@ -132,7 +132,7 @@ void KMailPluginEditorConvertTextManagerInterface::setRichTextEditor(KPIMTextEdi
QHash<MessageComposer::PluginActionType::Type, QList<QAction *>> KMailPluginEditorConvertTextManagerInterface::actionsType()
{
if (mActionHash.isEmpty()) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : std::as_const(mListPluginInterface)) {
const auto actionTypes = interface->actionTypes();
for (const MessageComposer::PluginActionType &actionType : actionTypes) {
MessageComposer::PluginActionType::Type type = actionType.type();
......@@ -189,7 +189,7 @@ QList<QAction *> KMailPluginEditorConvertTextManagerInterface::actionsType(Messa
QList<QWidget *> KMailPluginEditorConvertTextManagerInterface::statusBarWidgetList()
{
if (mStatusBarWidget.isEmpty() && !mListPluginInterface.isEmpty()) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorConvertTextInterface *interface : std::as_const(mListPluginInterface)) {
if (interface->plugin()->hasStatusBarSupport()) {
mStatusBarWidget.append(interface->statusBarWidget());
}
......
......@@ -91,7 +91,7 @@ void KMailPluginEditorManagerInterface::setComposerInterface(MessageComposer::Co
bool KMailPluginEditorManagerInterface::processProcessKeyEvent(QKeyEvent *event)
{
if (!mListPluginInterface.isEmpty()) {
for (MessageComposer::PluginEditorInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorInterface *interface : std::as_const(mListPluginInterface)) {
if (static_cast<MessageComposer::PluginEditor *>(interface->plugin())->canProcessKeyEvent()) {
if (interface->processProcessKeyEvent(event)) {
return true;
......@@ -120,7 +120,7 @@ QList<QAction *> KMailPluginEditorManagerInterface::actionsType(MessageComposer:
void KMailPluginEditorManagerInterface::setStatusBarWidgetEnabled(MessageComposer::PluginEditorInterface::ApplyOnFieldType type)
{
if (!mStatusBarWidget.isEmpty()) {
for (MessageComposer::PluginEditorInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorInterface *interface : std::as_const(mListPluginInterface)) {
if (auto w = interface->statusBarWidget()) {
w->setEnabled((interface->applyOnFieldTypes() & type));
}
......@@ -131,7 +131,7 @@ void KMailPluginEditorManagerInterface::setStatusBarWidgetEnabled(MessageCompose
QList<QWidget *> KMailPluginEditorManagerInterface::statusBarWidgetList()
{
if (mStatusBarWidget.isEmpty() && !mListPluginInterface.isEmpty()) {
for (MessageComposer::PluginEditorInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorInterface *interface : std::as_const(mListPluginInterface)) {
if (interface->plugin()->hasStatusBarSupport()) {
mStatusBarWidget.append(interface->statusBarWidget());
}
......@@ -143,7 +143,7 @@ QList<QWidget *> KMailPluginEditorManagerInterface::statusBarWidgetList()
QHash<MessageComposer::PluginActionType::Type, QList<QAction *>> KMailPluginEditorManagerInterface::actionsType()
{
if (mActionHash.isEmpty() && !mListPluginInterface.isEmpty()) {
for (MessageComposer::PluginEditorInterface *interface : qAsConst(mListPluginInterface)) {
for (MessageComposer::PluginEditorInterface *interface : std::as_const(mListPluginInterface)) {
const MessageComposer::PluginActionType actionType = interface->actionType();
MessageComposer::PluginActionType::Type type = actionType.type();
const bool needSelectedText = interface->needSelectedText();
......
......@@ -45,7 +45,7 @@ bool PotentialPhishingEmailJob::start()
deleteLater();
return false;
}
for (const QString &addr : qAsConst(mEmails)) {
for (const QString &addr : std::as_const(mEmails)) {
if (!mEmailWhiteList.contains(addr.trimmed())) {
QString tname, temail;
KEmailAddress::extractEmailAddressAndName(addr, temail, tname); // ignore return value
......
......@@ -42,7 +42,7 @@ void FolderArchiveManager::slotCollectionRemoved(const Akonadi::Collection &coll
{
KConfig config(FolderArchive::FolderArchiveUtil::configFileName());
mFolderArchiveCache->clearCacheWithContainsCollection(collection.id());
for (FolderArchiveAccountInfo *info : qAsConst(mListAccountInfo)) {
for (FolderArchiveAccountInfo *info : std::as_const(mListAccountInfo)) {
if (info->archiveTopLevel() == collection.id()) {
info->setArchiveTopLevel(-1);
KConfigGroup group = config.group(FolderArchive::FolderArchiveUtil::groupConfigPattern() + info->instanceName());
......@@ -54,7 +54,7 @@ void FolderArchiveManager::slotCollectionRemoved(const Akonadi::Collection &coll
FolderArchiveAccountInfo *FolderArchiveManager::infoFromInstanceName(const QString &instanceName) const
{
for (FolderArchiveAccountInfo *info : qAsConst(mListAccountInfo)) {
for (FolderArchiveAccountInfo *info : std::as_const(mListAccountInfo)) {
if (info->instanceName() == instanceName) {
return info;
}
......@@ -124,7 +124,7 @@ void FolderArchiveManager::setArchiveItems(const Akonadi::Item::List &items, con
void FolderArchiveManager::slotInstanceRemoved(const Akonadi::AgentInstance &instance)
{
const QString instanceName = instance.name();
for (FolderArchiveAccountInfo *info : qAsConst(mListAccountInfo)) {
for (FolderArchiveAccountInfo *info : std::as_const(mListAccountInfo)) {
if (info->instanceName() == instanceName) {
mListAccountInfo.removeAll(info);
removeInfo(instanceName);
......
......@@ -243,7 +243,7 @@ void KMCommand::start()
}
// we can only retrieve items with a valid id
for (const Akonadi::Item &item : qAsConst(mMsgList)) {
for (const Akonadi::Item &item : std::as_const(mMsgList)) {
if (!item.isValid()) {
Q_EMIT messagesTransfered(Failed);
return;
......@@ -981,7 +981,7 @@ KMCommand::Result KMForwardAttachedCommand::execute()
if (!mWin) {
mWin = KMail::makeComposer(fwdMsg.first, false, false, KMail::Composer::Forward, mIdentity);
}
for (KMime::Content *attach : qAsConst(fwdMsg.second)) {
for (KMime::Content *attach : std::as_const(fwdMsg.second)) {
mWin->addAttach(attach);
delete attach;
}
......@@ -1209,7 +1209,7 @@ KMSetTagCommand::KMSetTagCommand(const Akonadi::Tag::List &tags, const Akonadi::
KMCommand::Result KMSetTagCommand::execute()
{
for (const Akonadi::Tag &tag : qAsConst(mTags)) {
for (const Akonadi::Tag &tag : std::as_const(mTags)) {
if (!tag.isValid()) {
auto createJob = new Akonadi::TagCreateJob(tag, this);
connect(createJob, &Akonadi::TagCreateJob::result, this, &KMSetTagCommand::slotModifyItemDone);
......@@ -1231,7 +1231,7 @@ void KMSetTagCommand::setTags()
{
Akonadi::Item::List itemsToModify;
itemsToModify.reserve(mItem.count());
for (const Akonadi::Item &i : qAsConst(mItem)) {
for (const Akonadi::Item &i : std::as_const(mItem)) {
Akonadi::Item item(i);
if (mMode == CleanExistingAndAddNew) {
// WorkAround. ClearTags doesn't work.
......@@ -1243,7 +1243,7 @@ void KMSetTagCommand::setTags()
}
if (mMode == KMSetTagCommand::Toggle) {
for (const Akonadi::Tag &tag : qAsConst(mCreatedTags)) {
for (const Akonadi::Tag &tag : std::as_const(mCreatedTags)) {
if (item.hasTag(tag)) {
item.clearTag(tag);
} else {
......@@ -1266,7 +1266,7 @@ void KMSetTagCommand::setTags()
KConfigGroup tag(KMKernel::self()->config(), "MessageListView");
const QString oldTagList = tag.readEntry("TagSelected");
QStringList lst = oldTagList.split(QLatin1Char(','));
for (const Akonadi::Tag &createdTag : qAsConst(mCreatedTags)) {
for (const Akonadi::Tag &createdTag : std::as_const(mCreatedTags)) {
const QString url = createdTag.url().url();
if (!lst.contains(url)) {
lst.append(url);
......@@ -1304,7 +1304,7 @@ KMCommand::Result KMFilterActionCommand::execute()
KPIM::ProgressItem::Unknown);
progressItem->setTotalItems(msgCountToFilter);
for (const qlonglong &id : qAsConst(mMsgListId)) {
for (const qlonglong &id : std::as_const(mMsgListId)) {
int diff = msgCountToFilter - ++msgCount;
if (diff < 10 || !(msgCount % 10) || msgCount <= 10) {
progressItem->updateProgress();
......@@ -1495,7 +1495,7 @@ KMCommand::Result KMMoveCommand::execute()
});
Akonadi::Collection parent;
int undoId = -1;
for (const Akonadi::Item &item : qAsConst(retrievedList)) {
for (const Akonadi::Item &item : std::as_const(retrievedList)) {
if (item.storageCollectionId() <= 0) {
continue;
}
......@@ -1622,7 +1622,7 @@ KMCommand::Result KMTrashMsgCommand::execute()
});
Akonadi::Collection parent;
int undoId = -1;
for (const Akonadi::Item &item : qAsConst(*trashIt)) {
for (const Akonadi::Item &item : std::as_const(*trashIt)) {
if (item.storageCollectionId() <= 0) {
continue;
}
......@@ -1699,10 +1699,10 @@ void KMTrashMsgCommand::slotMoveCanceled()
void KMTrashMsgCommand::completeMove(KMCommand::Result result)
{
if (result == Failed) {
for (auto job : qAsConst(mPendingMoves)) {
for (auto job : std::as_const(mPendingMoves)) {
job->kill();
}
for (auto job : qAsConst(mPendingDeletes)) {
for (auto job : std::as_const(mPendingDeletes)) {
job->kill();
}
}
......
......@@ -293,7 +293,7 @@ bool KMKernel::handleCommandLine(bool noArgsOpensReader, const QStringList &args
kmail_options(&parser);
QStringList newargs;
bool addAttachmentAttribute = false;
for (const QString &argument : qAsConst(args)) {
for (const QString &argument : std::as_const(args)) {
if (argument == QLatin1String("--attach")) {
addAttachmentAttribute = true;
} else {
......@@ -1881,7 +1881,7 @@ void KMKernel::checkFolderFromResources(const Akonadi::Collection::List &collect
} else if (typeIdentifier.contains(POP3_RESOURCE_IDENTIFIER)) {
OrgKdeAkonadiPOP3SettingsInterface *iface = MailCommon::Util::createPop3SettingsInterface(typeIdentifier);
if (iface->isValid()) {
for (const Akonadi::Collection &collection : qAsConst(collectionList)) {
for (const Akonadi::Collection &collection : std::as_const(collectionList)) {
const Akonadi::Collection::Id collectionId = collection.id();
if (iface->targetCollection() == collectionId) {
// Use default inbox
......
......@@ -3782,7 +3782,7 @@ void KMMainWidget::updateMessageActionsDelayed()
}
// Enable / disable all filters.
for (QAction *filterAction : qAsConst(mFilterMenuActions)) {
for (QAction *filterAction : std::as_const(mFilterMenuActions)) {
filterAction->setEnabled(count > 0);
}
......@@ -3962,10 +3962,10 @@ void KMMainWidget::updateFolderMenu()
mApplyAllFiltersFolderAction->setEnabled(folderIsValid);
mApplyFilterFolderActionsMenu->setEnabled(folderIsValid);
mApplyFilterFolderRecursiveActionsMenu->setEnabled(folderIsValid);
for (auto a : qAsConst(mFilterFolderMenuActions)) {
for (auto a : std::as_const(mFilterFolderMenuActions)) {
a->setEnabled(folderIsValid);
}
for (auto a : qAsConst(mFilterFolderMenuRecursiveActions)) {
for (auto a : std::as_const(mFilterFolderMenuRecursiveActions)) {
a->setEnabled(folderIsValid);
}
if (mCurrentCollection.resource() == QLatin1String("akonadi_unifiedmailbox_agent")) {
......@@ -4070,13 +4070,13 @@ void KMMainWidget::clearFilterActions()
}
}
for (QAction *a : qAsConst(mFilterMenuActions)) {
for (QAction *a : std::as_const(mFilterMenuActions)) {
actionCollection()->removeAction(a);
}
for (QAction *a : qAsConst(mFilterFolderMenuActions)) {
for (QAction *a : std::as_const(mFilterFolderMenuActions)) {
actionCollection()->removeAction(a);
}
for (QAction *a : qAsConst(mFilterFolderMenuRecursiveActions)) {
for (QAction *a : std::as_const(mFilterFolderMenuRecursiveActions)) {
actionCollection()->removeAction(a);
}
......
......@@ -49,7 +49,7 @@ void SummaryView::fillSyncActionSubEntries()
menuItems << reply.value();
}
for (const QString &acc : qAsConst(menuItems)) {
for (const QString &acc : std::as_const(menuItems)) {
mSyncAction->addAction(acc);
}
}
......
......@@ -548,7 +548,7 @@ void SearchWindow::searchDone(KJob *job)
searchDescription->setBaseCollection(Akonadi::Collection());
QList<Akonadi::Collection::Id> lst;
lst.reserve(mCollectionId.count());
for (const Akonadi::Collection &col : qAsConst(mCollectionId)) {
for (const Akonadi::Collection &col : std::as_const(mCollectionId)) {
lst << col.id();
}
searchDescription->setListCollection(lst);
......@@ -859,7 +859,7 @@ void SearchWindow::slotSelectMultipleFolders()
if (!mSelectMultiCollectionDialog) {
QList<Akonadi::Collection::Id> lst;
lst.reserve(mCollectionId.count());
for (const Akonadi::Collection &col : qAsConst(mCollectionId)) {
for (const Akonadi::Collection &col : std::as_const(mCollectionId)) {
lst << col.id();
}
mSelectMultiCollectionDialog = new PimCommon::SelectMultiCollectionDialog(KMime::Message::mimeType(), lst, this);
......@@ -898,7 +898,7 @@ QVector<qint64> SearchWindow::checkIncompleteIndex(const Akonadi::Collection::Li
mUi.mProgressIndicator->hide();
mUi.mStatusLbl->setText(i18n("Checking index status..."));
// Fetch collection ?
for (const Akonadi::Collection &col : qAsConst(cols)) {
for (const Akonadi::Collection &col : std::as_const(cols)) {
const qlonglong num = KMKernel::self()->indexedItems()->indexedItems((qlonglong)col.id());
if (col.statistics().count() != num) {
results.push_back(col.id());
......
......@@ -56,7 +56,7 @@ void TagActionManager::clearActions()
// Remove the tag actions from the status menu and the action collection,
// then delete them.
for (KToggleAction *action : qAsConst(mTagActions)) {
for (KToggleAction *action : std::as_const(mTagActions)) {
mMessageActions->messageStatusMenu()->removeAction(action);
// This removes and deletes the action at the same time
......
Supports Markdown
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