Commit ee939270 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

GIT_SILENT: we depend against c++17

parent 8274c804
Pipeline #68583 passed with stage
in 40 minutes and 4 seconds
......@@ -214,7 +214,7 @@ void AttachmentControllerBase::Private::loadJobResult(KJob *job)
void AttachmentControllerBase::Private::openSelectedAttachments()
{
Q_ASSERT(selectedParts.count() >= 1);
for (const AttachmentPart::Ptr &part : qAsConst(selectedParts)) {
for (const AttachmentPart::Ptr &part : std::as_const(selectedParts)) {
q->openAttachment(part);
}
}
......@@ -222,7 +222,7 @@ void AttachmentControllerBase::Private::openSelectedAttachments()
void AttachmentControllerBase::Private::viewSelectedAttachments()
{
Q_ASSERT(selectedParts.count() >= 1);
for (const AttachmentPart::Ptr &part : qAsConst(selectedParts)) {
for (const AttachmentPart::Ptr &part : std::as_const(selectedParts)) {
q->viewAttachment(part);
}
}
......
......@@ -214,7 +214,7 @@ bool AttachmentModel::isEncryptSelected() const
void AttachmentModel::setEncryptSelected(bool selected)
{
d->encryptSelected = selected;
for (AttachmentPart::Ptr part : qAsConst(d->parts)) {
for (AttachmentPart::Ptr part : std::as_const(d->parts)) {
part->setEncrypted(selected);
}
Q_EMIT dataChanged(index(0, EncryptColumn), index(rowCount() - 1, EncryptColumn));
......@@ -228,7 +228,7 @@ bool AttachmentModel::isSignSelected() const
void AttachmentModel::setSignSelected(bool selected)
{
d->signSelected = selected;
for (AttachmentPart::Ptr part : qAsConst(d->parts)) {
for (AttachmentPart::Ptr part : std::as_const(d->parts)) {
part->setSigned(selected);
}
Q_EMIT dataChanged(index(0, SignColumn), index(rowCount() - 1, SignColumn));
......@@ -356,7 +356,7 @@ void AttachmentModel::addAttachment(const AttachmentPart::Ptr &part)
{
Q_ASSERT(!d->parts.contains(part));
if (!part->url().isEmpty()) {
for (const AttachmentPart::Ptr &partElement : qAsConst(d->parts)) {
for (const AttachmentPart::Ptr &partElement : std::as_const(d->parts)) {
if (partElement->url() == part->url()) {
return;
}
......
......@@ -152,7 +152,7 @@ void ComposerPrivate::composeStep2()
auto multipartJob = new MultipartJob(q);
multipartJob->setMultipartSubtype("mixed");
multipartJob->appendSubjob(subJob);
for (const AttachmentPart::Ptr &part : qAsConst(attachmentParts)) {
for (const AttachmentPart::Ptr &part : std::as_const(attachmentParts)) {
multipartJob->appendSubjob(new AttachmentJob(part));
}
mainJob = multipartJob;
......@@ -174,7 +174,7 @@ void ComposerPrivate::composeStep2()
auto multipartJob = new MultipartJob(q);
multipartJob->setMultipartSubtype("mixed");
multipartJob->appendSubjob(subJob);
for (const AttachmentPart::Ptr &part : qAsConst(attachmentParts)) {
for (const AttachmentPart::Ptr &part : std::as_const(attachmentParts)) {
multipartJob->appendSubjob(new AttachmentJob(part));
}
mainJob = multipartJob;
......@@ -209,7 +209,7 @@ void ComposerPrivate::composeStep2()
auto multipartJob = new MultipartJob(q);
multipartJob->setMultipartSubtype("mixed");
multipartJob->appendSubjob(mainTextJob);
for (const AttachmentPart::Ptr &part : qAsConst(attachmentParts)) {
for (const AttachmentPart::Ptr &part : std::as_const(attachmentParts)) {
multipartJob->appendSubjob(new AttachmentJob(part));
}
mainJob = multipartJob;
......@@ -390,7 +390,7 @@ void ComposerPrivate::composeWithLateAttachments(KMime::Message *headers,
qCDebug(MESSAGECOMPOSER_LOG) << "attachment encr key size:" << keys.size() << " recipients: " << recipients;
// operate correctly on each attachment that has a different crypto policy than body.
for (const AttachmentPart::Ptr &attachment : qAsConst(parts)) {
for (const AttachmentPart::Ptr &attachment : std::as_const(parts)) {
auto attachJob = new AttachmentJob(attachment, q);
qCDebug(MESSAGECOMPOSER_LOG) << "got a late attachment";
......
......@@ -213,7 +213,7 @@ void MessageFactoryNG::createReplyAsync()
if (!mMailingListAddresses.isEmpty()) {
toList = stripMyAddressesFromAddressList(mOrigMsg->to()->mailboxes(), mIdentityManager);
bool addMailingList = true;
for (const KMime::Types::Mailbox &m : qAsConst(mMailingListAddresses)) {
for (const KMime::Types::Mailbox &m : std::as_const(mMailingListAddresses)) {
if (toList.contains(m)) {
addMailingList = false;
break;
......@@ -242,7 +242,7 @@ void MessageFactoryNG::createReplyAsync()
}
}
for (const KMime::Types::Mailbox &mailbox : qAsConst(ccList)) {
for (const KMime::Types::Mailbox &mailbox : std::as_const(ccList)) {
msg->cc()->addAddress(mailbox);
}
}
......@@ -258,7 +258,7 @@ void MessageFactoryNG::createReplyAsync()
Q_UNREACHABLE();
}
for (const KMime::Types::Mailbox &mailbox : qAsConst(toList)) {
for (const KMime::Types::Mailbox &mailbox : std::as_const(toList)) {
msg->to()->addAddress(mailbox);
}
......@@ -386,7 +386,7 @@ QPair<KMime::Message::Ptr, QVector<KMime::Content *>> MessageFactoryNG::createAt
} else {
// iterate through all the messages to be forwarded
attachments.reserve(items.count());
for (const Akonadi::Item &item : qAsConst(items)) {
for (const Akonadi::Item &item : std::as_const(items)) {
attachments << createForwardAttachmentMessage(MessageComposer::Util::message(item));
MessageComposer::Util::addLinkInformation(msg, item.id(), Akonadi::MessageStatus::statusForwarded());
}
......@@ -716,7 +716,7 @@ QPair<KMime::Message::Ptr, KMime::Content *> MessageFactoryNG::createForwardDige
digest->fromUnicodeString(mainPartText);
int id = 0;
for (const Akonadi::Item &item : qAsConst(items)) {
for (const Akonadi::Item &item : std::as_const(items)) {
KMime::Message::Ptr fMsg = MessageComposer::Util::message(item);
if (id == 0) {
if (auto hrd = fMsg->headerByType("X-KMail-Identity")) {
......
......@@ -34,7 +34,7 @@ void AliasesExpandJob::start()
{
// At first we try to expand the recipient to a distribution list
// or nick name and save the results in a map for later lookup
for (const QString &recipient : qAsConst(mRecipients)) {
for (const QString &recipient : std::as_const(mRecipients)) {
// speedup: assume aliases and list names don't contain '@'
if (recipient.isEmpty() || recipient.contains(QLatin1Char('@'))) {
continue;
......@@ -123,7 +123,7 @@ void AliasesExpandJob::slotNicknameExpansionDone(KJob *job)
void AliasesExpandJob::finishExpansion()
{
for (const QString &recipient : qAsConst(mRecipients)) {
for (const QString &recipient : std::as_const(mRecipients)) {
if (recipient.isEmpty()) {
continue;
}
......
......@@ -113,7 +113,7 @@ void EmailAddressResolveJob::start()
if (d->mJobCount == 0) {
emitResult();
} else {
for (AliasesExpandJob *job : qAsConst(jobs)) {
for (AliasesExpandJob *job : std::as_const(jobs)) {
job->start();
}
}
......
......@@ -56,7 +56,7 @@ void MultipartJob::process()
contentType->setBoundary(KMime::multiPartBoundary());
d->resultContent->contentTransferEncoding()->setEncoding(KMime::Headers::CE7Bit);
d->resultContent->setPreamble("This is a multi-part message in MIME format.\n");
for (KMime::Content *c : qAsConst(d->subjobContents)) {
for (KMime::Content *c : std::as_const(d->subjobContents)) {
d->resultContent->addContent(c);
if (c->contentTransferEncoding()->encoding() == KMime::Headers::CE8Bit) {
d->resultContent->contentTransferEncoding()->setEncoding(KMime::Headers::CE8Bit);
......
......@@ -194,7 +194,7 @@ void DistributionListDialog::slotDelayedSetRecipients(KJob *job)
item->setCheckState(0, Qt::Checked);
} else {
bool isFirst = true;
for (const Akonadi::Item &akItem : qAsConst(akItems)) {
for (const Akonadi::Item &akItem : std::as_const(akItems)) {
if (akItem.hasPayload<KContacts::Addressee>()) {
const auto contact = akItem.payload<KContacts::Addressee>();
......
......@@ -274,7 +274,7 @@ void MessageComposer::Util::addSendReplyForwardAction(const KMime::Message::Ptr
QVector<Akonadi::Item::Id> originalMessageId;
QVector<Akonadi::MessageStatus> linkStatus;
if (MessageComposer::Util::getLinkInformation(message, originalMessageId, linkStatus)) {
for (Akonadi::Item::Id id : qAsConst(originalMessageId)) {
for (Akonadi::Item::Id id : std::as_const(originalMessageId)) {
if (linkStatus.first() == Akonadi::MessageStatus::statusReplied()) {
qjob->sentActionAttribute().addAction(MailTransport::SentActionAttribute::Action::MarkAsReplied, QVariant(id));
} else if (linkStatus.first() == Akonadi::MessageStatus::statusForwarded()) {
......
......@@ -23,7 +23,7 @@ Filter::Filter(QObject *parent)
bool Filter::containString(const QString &searchInString) const
{
bool found = false;
for (const QString &str : qAsConst(mSearchList)) {
for (const QString &str : std::as_const(mSearchList)) {
if (searchInString.contains(str, Qt::CaseInsensitive)) {
found = true;
} else {
......@@ -67,7 +67,7 @@ void Filter::setIdentifier(const QString &newIdentifier)
bool Filter::match(const MessageItem *item) const
{
if (!mStatus.isEmpty()) {
for (Akonadi::MessageStatus status : qAsConst(mStatus)) {
for (Akonadi::MessageStatus status : std::as_const(mStatus)) {
if (!(status & item->status())) {
return false;
}
......@@ -170,7 +170,7 @@ void Filter::save(const KSharedConfig::Ptr &config, const QString &filtername, c
newGroup.writeEntry("identifier", mIdentifier);
QList<qint32> lst;
lst.reserve(mStatus.count());
for (const auto s : qAsConst(mStatus)) {
for (const auto s : std::as_const(mStatus)) {
lst << s.toQInt32();
}
newGroup.writeEntry("status", lst);
......@@ -203,7 +203,7 @@ Filter *Filter::loadFromConfigGroup(const KConfigGroup &newGroup)
lst = newGroup.readEntry("status", QList<qint32>());
QVector<Akonadi::MessageStatus> messageStatusLst;
messageStatusLst.reserve(lst.count());
for (const auto s : qAsConst(lst)) {
for (const auto s : std::as_const(lst)) {
Akonadi::MessageStatus status;
status.fromQInt32(s);
messageStatusLst << status;
......
......@@ -107,7 +107,7 @@ void FilterSavedManager::removeFilter(const QString &identifier)
}
int numberOfFilter = 0;
for (Filter *f : qAsConst(lst)) {
for (Filter *f : std::as_const(lst)) {
if ((f->identifier() != identifier) && !f->identifier().isEmpty()) {
f->save(KSharedConfig::openConfig(), f->filterName(), f->iconName());
numberOfFilter++;
......
......@@ -46,7 +46,7 @@ void Item::childItemStats(ChildItemStats &stats) const
Q_ASSERT(d_ptr->mChildItems);
stats.mTotalChildCount += d_ptr->mChildItems->count();
for (const auto child : qAsConst(*d_ptr->mChildItems)) {
for (const auto child : std::as_const(*d_ptr->mChildItems)) {
if (!child->status().isRead()) {
stats.mUnreadChildCount++;
}
......@@ -325,7 +325,7 @@ bool Item::recomputeMaxDate()
time_t newMaxDate = d_ptr->mDate;
if (d_ptr->mChildItems) {
for (auto child : qAsConst(*d_ptr->mChildItems)) {
for (auto child : std::as_const(*d_ptr->mChildItems)) {
if (child->d_ptr->mMaxDate > newMaxDate) {
newMaxDate = child->d_ptr->mMaxDate;
}
......@@ -394,11 +394,11 @@ void Item::setViewable(Model *model, bool bViewable)
d_ptr->mIsViewable = true;
}
for (const auto child : qAsConst(*d_ptr->mChildItems)) {
for (const auto child : std::as_const(*d_ptr->mChildItems)) {
child->setViewable(model, bViewable);
}
} else {
for (const auto child : qAsConst(*d_ptr->mChildItems)) {
for (const auto child : std::as_const(*d_ptr->mChildItems)) {
child->setViewable(model, bViewable);
}
......@@ -629,7 +629,7 @@ void Item::dump(const QString &prefix)
return;
}
for (const auto child : qAsConst(*d_ptr->mChildItems)) {
for (const auto child : std::as_const(*d_ptr->mChildItems)) {
child->dump(nPrefix);
}
}
......
......@@ -556,7 +556,7 @@ QString MessageItem::accessibleText(const Theme *theme, int columnIndex)
QStringList rightStrings;
const auto leftItems = row->leftItems();
leftStrings.reserve(leftItems.count());
for (Theme::ContentItem *contentItem : qAsConst(leftItems)) {
for (Theme::ContentItem *contentItem : std::as_const(leftItems)) {
leftStrings.append(accessibleTextForField(contentItem->type()));
}
......@@ -579,7 +579,7 @@ void MessageItem::subTreeToList(QVector<MessageItem *> &list)
if (!childList) {
return;
}
for (const auto child : qAsConst(*childList)) {
for (const auto child : std::as_const(*childList)) {
Q_ASSERT(child->type() == Item::Message);
static_cast<MessageItem *>(child)->subTreeToList(list);
}
......
......@@ -411,7 +411,7 @@ void ModelPrivate::slotApplyFilter()
QModelIndex idx; // invalid
QApplication::setOverrideCursor(Qt::WaitCursor);
for (const auto child : qAsConst(*childList)) {
for (const auto child : std::as_const(*childList)) {
applyFilterToSubtree(child, idx);
}
......@@ -439,7 +439,7 @@ bool ModelPrivate::applyFilterToSubtree(Item *item, const QModelIndex &parentInd
QModelIndex thisIndex = q->index(item, 0);
if (childList) {
for (const auto child : qAsConst(*childList)) {
for (const auto child : std::as_const(*childList)) {
if (applyFilterToSubtree(child, thisIndex)) {
childrenMatch = true;
}
......@@ -1047,13 +1047,13 @@ void ModelPrivate::clearUnassignedMessageLists()
// items and *then* delete them without accessing the parented ones.
QList<MessageItem *> parentless;
for (const auto mi : qAsConst(mUnassignedMessageListForPass2)) {
for (const auto mi : std::as_const(mUnassignedMessageListForPass2)) {
if (!mi->parent()) {
parentless.append(mi);
}
}
for (const auto mi : qAsConst(parentless)) {
for (const auto mi : std::as_const(parentless)) {
delete mi;
}
......@@ -1077,17 +1077,17 @@ void ModelPrivate::clearUnassignedMessageLists()
// We're actually in Pass3: the messiest one.
QSet<MessageItem *> itemsToDelete;
for (const auto mi : qAsConst(mUnassignedMessageListForPass3)) {
for (const auto mi : std::as_const(mUnassignedMessageListForPass3)) {
if (!mi->parent()) {
itemsToDelete.insert(mi);
}
}
for (const auto mi : qAsConst(mUnassignedMessageListForPass4)) {
for (const auto mi : std::as_const(mUnassignedMessageListForPass4)) {
if (!mi->parent()) {
itemsToDelete.insert(mi);
}
}
for (const auto mi : qAsConst(itemsToDelete)) {
for (const auto mi : std::as_const(itemsToDelete)) {
delete mi;
}
......@@ -1099,12 +1099,12 @@ void ModelPrivate::clearUnassignedMessageLists()
// mUnassignedMessageListForPass4 is empty so we must be at the end of a very special kind of Pass2
// We have the same problem as in mUnassignedMessageListForPass2.
QList<MessageItem *> parentless;
for (const auto mi : qAsConst(mUnassignedMessageListForPass3)) {
for (const auto mi : std::as_const(mUnassignedMessageListForPass3)) {
if (!mi->parent()) {
parentless.append(mi);
}
}
for (const auto mi : qAsConst(parentless)) {
for (const auto mi : std::as_const(parentless)) {
delete mi;
}
......@@ -1118,12 +1118,12 @@ void ModelPrivate::clearUnassignedMessageLists()
// We have the same problem as in mUnassignedMessageListForPass2.
QList<MessageItem *> parentless;
for (const auto mi : qAsConst(mUnassignedMessageListForPass4)) {
for (const auto mi : std::as_const(mUnassignedMessageListForPass4)) {
if (!mi->parent()) {
parentless.append(mi);
}
}
for (const auto mi : qAsConst(parentless)) {
for (const auto mi : std::as_const(parentless)) {
delete mi;
}
......@@ -1251,7 +1251,7 @@ void ModelPrivate::saveExpandedStateOfSubtree(Item *root)
if (!children) {
return;
}
for (const auto mi : qAsConst(*children)) {
for (const auto mi : std::as_const(*children)) {
if (mi->childItemCount() > 0 // has children
&& mi->isViewable() // is actually attached to the viewable root
&& mView->isExpanded(q->index(mi, 0))) { // is actually expanded
......@@ -1280,7 +1280,7 @@ void ModelPrivate::syncExpandedStateOfSubtree(Item *root)
return;
}
for (const auto mi : qAsConst(*children)) {
for (const auto mi : std::as_const(*children)) {
if (mi->initialExpandStatus() == Item::ExpandNeeded) {
if (mi->childItemCount() > 0) {
syncExpandedStateOfSubtree(mi);
......@@ -1767,7 +1767,7 @@ MessageItem *ModelPrivate::guessMessageParent(MessageItem *mi)
// FIXME: This might be speed up with an initial binary search (?)
// ANSWER: No. We can't rely on date order (as it can be updated on the fly...)
for (const auto it : qAsConst(*messagesWithTheSameStrippedSubject)) {
for (const auto it : std::as_const(*messagesWithTheSameStrippedSubject)) {
int delta = mi->date() - it->date();
// We don't take into account messages with a delta smaller than 120.
......@@ -3653,7 +3653,7 @@ void ModelPrivate::printStatistics()
int messagesWithSameSubjectAvg = 0;
int messagesWithSameSubjectMax = 0;
for (const auto messages : qAsConst(mThreadingCacheMessageSubjectMD5ToMessageItem)) {
for (const auto messages : std::as_const(mThreadingCacheMessageSubjectMD5ToMessageItem)) {
if (messages->size() > messagesWithSameSubjectMax) {
messagesWithSameSubjectMax = messages->size();
}
......@@ -3663,7 +3663,7 @@ void ModelPrivate::printStatistics()
int totalThreads = 0;
if (!mGroupHeaderItemHash.isEmpty()) {
for (const GroupHeaderItem *groupHeader : qAsConst(mGroupHeaderItemHash)) {
for (const GroupHeaderItem *groupHeader : std::as_const(mGroupHeaderItemHash)) {
totalThreads += groupHeader->childItemCount();
}
} else {
......@@ -3856,7 +3856,7 @@ ModelPrivate::ViewItemJobResult ModelPrivate::viewItemJobStepInternal()
auto rootChildItems = mRootItem->childItems();
if (rootChildItems) {
for (const auto it : qAsConst(*rootChildItems)) {
for (const auto it : std::as_const(*rootChildItems)) {
if (it->initialExpandStatus() == Item::ExpandNeeded) {
syncExpandedStateOfSubtree(it);
}
......
......@@ -36,7 +36,7 @@ public:
~RowShift()
{
for (const auto idx : qAsConst(*mInvariantHash)) {
for (const auto idx : std::as_const(*mInvariantHash)) {
idx->d->setRowMapper(nullptr);
}
delete mInvariantHash;
......@@ -70,7 +70,7 @@ ModelInvariantRowMapper::~ModelInvariantRowMapper()
}
// FIXME: optimize this (it CAN be optimized)
for (const auto idx : qAsConst(*d->mCurrentInvariantHash)) {
for (const auto idx : std::as_const(*d->mCurrentInvariantHash)) {
idx->d->setRowMapper(nullptr);
}
delete d->mCurrentInvariantHash;
......@@ -550,7 +550,7 @@ void ModelInvariantRowMapper::modelReset()
{
// FIXME: optimize this (it probably can be optimized by providing a more complex user interface)
for (const auto idx : qAsConst(*d->mCurrentInvariantHash)) {
for (const auto idx : std::as_const(*d->mCurrentInvariantHash)) {
idx->d->setRowMapper(nullptr);
}
d->mCurrentInvariantHash->clear();
......
......@@ -351,11 +351,11 @@ Theme::Row::Row()
Theme::Row::Row(const Row &src)
{
for (const auto ci : qAsConst(src.mLeftItems)) {
for (const auto ci : std::as_const(src.mLeftItems)) {
addLeftItem(new ContentItem(*ci));
}
for (const auto ci : qAsConst(src.mRightItems)) {
for (const auto ci : std::as_const(src.mRightItems)) {
addRightItem(new ContentItem(*ci));
}
}
......@@ -425,12 +425,12 @@ void Theme::Row::removeRightItem(Theme::ContentItem *item)
bool Theme::Row::containsTextItems() const
{
for (const auto ci : qAsConst(mLeftItems)) {
for (const auto ci : std::as_const(mLeftItems)) {
if (ci->displaysText()) {
return true;
}
}
for (const auto ci : qAsConst(mRightItems)) {
for (const auto ci : std::as_const(mRightItems)) {
if (ci->displaysText()) {
return true;
}
......@@ -623,11 +623,11 @@ Theme::Column::Column(const Column &src)
mSharedRuntimeData = src.mSharedRuntimeData;
mSharedRuntimeData->addReference();
for (const auto row : qAsConst(src.mMessageRows)) {
for (const auto row : std::as_const(src.mMessageRows)) {
addMessageRow(new Row(*row));
}
for (const auto row : qAsConst(src.mGroupHeaderRows)) {
for (const auto row : std::as_const(src.mGroupHeaderRows)) {
addGroupHeaderRow(new Row(*row));
}
}
......@@ -786,12 +786,12 @@ void Theme::Column::removeGroupHeaderRow(Theme::Row *row)
bool Theme::Column::containsTextItems() const
{
for (const auto row : qAsConst(mMessageRows)) {
for (const auto row : std::as_const(mMessageRows)) {
if (row->containsTextItems()) {
return true;
}
}
for (const auto row : qAsConst(mGroupHeaderRows)) {
for (const auto row : std::as_const(mGroupHeaderRows)) {
if (row->containsTextItems()) {
return true;
}
......@@ -939,7 +939,7 @@ Theme::Theme(const Theme &src)
mGroupHeaderBackgroundStyle = src.mGroupHeaderBackgroundStyle;
mViewHeaderPolicy = src.mViewHeaderPolicy;
mIconSize = src.mIconSize;
for (const auto col : qAsConst(src.mColumns)) {
for (const auto col : std::as_const(src.mColumns)) {
addColumn(new Column(*col));
}
}
......@@ -952,14 +952,14 @@ Theme::~Theme()
void Theme::detach()
{
for (const auto col : qAsConst(mColumns)) {
for (const auto col : std::as_const(mColumns)) {
col->detach();
}
}
void Theme::resetColumnState()
{
for (const auto col : qAsConst(mColumns)) {
for (const auto col : std::as_const(mColumns)) {
col->setCurrentlyVisible(col->visibleByDefault());
col->setCurrentWidth(-1);
}
......@@ -967,7 +967,7 @@ void Theme::resetColumnState()
void Theme::resetColumnSizes()
{
for (const auto col : qAsConst(mColumns)) {
for (const auto col : std::as_const(mColumns)) {
col->setCurrentWidth(-1);
}
}
......
......@@ -556,13 +556,13 @@ static inline QSize compute_size_hint_for_row(const Theme::Row *r, int iconSize,
// right aligned stuff first
auto items = r->rightItems();
for (const auto it : qAsConst(items)) {
for (const auto it : std::as_const(items)) {
compute_size_hint_for_item(const_cast<Theme::ContentItem *>(it), maxh, totalw, iconSize, item);
}
// then left aligned stuff
items = r->leftItems();
for (const auto it : qAsConst(items)) {
for (const auto it : std::as_const(items)) {
compute_size_hint_for_item(const_cast<Theme::ContentItem *>(it), maxh, totalw, iconSize, item);
}
......@@ -806,7 +806,7 @@ void ThemeDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option,
Qt::LayoutDirection layoutDir = mItemView->layoutDirection();
for (const auto row : qAsConst(*rows)) {
for (const auto row : std::as_const(*rows)) {
QSize rowSizeHint = compute_size_hint_for_row(row, mTheme->iconSize(), item);
int bottom = top + rowSizeHint.height();
......@@ -1336,7 +1336,7 @@ bool ThemeDelegate::hitTest(const QPoint &viewportPoint, bool exact)
Qt::LayoutDirection layoutDir = mItemView->layoutDirection();
for (const auto row : qAsConst(*rows)) {
for (const auto row : std::as_const(*rows)) {
QSize rowSizeHint = compute_size_hint_for_row(row, mTheme->iconSize(), mHitItem);
if ((viewportPoint.y() < top) && (rowIdx > 0)) {
......
......@@ -376,7 +376,7 @@ void View::applyThemeColumns()
int totalVisibleWidthHint = 0;
QVector<int> lColumnSizeHints;
for (const auto col : qAsConst(columns)) {
for (const auto col : std::as_const(columns)) {
if (col->currentlyVisible() || (idx == 0)) {
// qCDebug(MESSAGELIST_LOG) << "Column " << idx << " will be visible";
// Column visible
......@@ -403,7 +403,7 @@ void View::applyThemeColumns()
QVector<double> lColumnWidths;
lColumnWidths.reserve(columns.count());
int totalVisibleWidth = 0;
for (const auto col : qAsConst(columns)) {