Commit 9f4c9ee0 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

use for(...:...)

parent 146ed433
Pipeline #92796 passed with stage
in 23 minutes and 7 seconds
......@@ -67,9 +67,8 @@ FilterLogDialog::FilterLogDialog(QWidget *parent)
mTextEdit->setReadOnly(true);
mTextEdit->editor()->setWordWrapMode(QTextOption::NoWrap);
const QStringList logEntries = FilterLog::instance()->logEntries();
QStringList::ConstIterator end(logEntries.constEnd());
for (QStringList::ConstIterator it = logEntries.constBegin(); it != end; ++it) {
mTextEdit->editor()->appendHtml(*it);
for (const QString &str : logEntries) {
mTextEdit->editor()->appendHtml(str);
}
auto purposeMenu = new MailfilterPurposeMenuWidget(this, this);
......
......@@ -424,10 +424,9 @@ void KTNEFMain::viewDoubleClicked(QTreeWidgetItem *item)
void KTNEFMain::viewDragRequested(const QList<KTnef::KTNEFAttach *> &list)
{
QList<QUrl> urlList;
QList<KTNEFAttach *>::ConstIterator end(list.constEnd());
urlList.reserve(list.count());
for (QList<KTNEFAttach *>::ConstIterator it = list.constBegin(); it != end; ++it) {
urlList << QUrl::fromLocalFile(extractTemp(*it));
for (const auto &att : list) {
urlList << QUrl::fromLocalFile(extractTemp(att));
}
if (!list.isEmpty()) {
......@@ -554,11 +553,8 @@ void KTNEFMain::createOpenWithMenu(QMenu *topMenu)
menu->menuAction()->setObjectName(QStringLiteral("openWith_submenu")); // for the unittest
topMenu->addMenu(menu);
}
KService::List::ConstIterator it = offers.constBegin();
KService::List::ConstIterator end = offers.constEnd();
for (; it != end; ++it) {
QAction *act = createAppAction(*it,
for (const auto &s : offers) {
QAction *act = createAppAction(s,
// no submenu -> prefix single offer
menu == topMenu,
actionGroup,
......
......@@ -83,10 +83,8 @@ void KTNEFView::setAttachments(const QList<KTNEFAttach *> &list)
{
clear();
if (!list.isEmpty()) {
QList<KTNEFAttach *>::ConstIterator it;
QList<KTNEFAttach *>::ConstIterator end(list.constEnd());
for (it = list.constBegin(); it != end; ++it) {
new Attachment(this, (*it));
for (const auto &s : list) {
new Attachment(this, s);
}
}
}
......
......@@ -91,12 +91,10 @@ void KMailPlugin::processDropEvent(QDropEvent *de)
storage.save();
openComposer(QUrl::fromLocalFile(tmp.fileName()));
} else if (KContacts::VCardDrag::fromMimeData(md, list)) {
KContacts::Addressee::List::ConstIterator it;
QStringList to;
to.reserve(list.count());
KContacts::Addressee::List::ConstIterator end(list.constEnd());
for (it = list.constBegin(); it != end; ++it) {
to.append((*it).fullEmail());
for (const auto &s : std::as_const(list)) {
to.append(s.fullEmail());
}
openComposer(to.join(QLatin1String(", ")));
}
......
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