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