From 9d87348260316af729892c58bc29f159a173abf1 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 23 Feb 2021 00:37:11 +0200 Subject: Minor code optimisation - Use more range-for loops where appropriate - Use auto instead of the usually-long iterator type names - Use cbegin/cend(), to match the std:: containers, less confusion - Use qDeleteAll instead of a for loop - Make a QRE with a long-ish pattern static NO_CHANGELOG --- src/core/kemailsettings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/kemailsettings.cpp') diff --git a/src/core/kemailsettings.cpp b/src/core/kemailsettings.cpp index cfebe2a8..9074a0a2 100644 --- a/src/core/kemailsettings.cpp +++ b/src/core/kemailsettings.cpp @@ -227,9 +227,9 @@ KEMailSettings::KEMailSettings() p->m_pConfig = new KConfig(QStringLiteral("emaildefaults")); const QStringList groups = p->m_pConfig->groupList(); - for (QStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it) { - if ((*it).startsWith(QLatin1String("PROFILE_"))) { - p->profiles += (*it).mid(8, (*it).length()); + for (const auto &grp : groups) { + if (grp.startsWith(QLatin1String("PROFILE_"))) { + p->profiles += grp.mid(8 /* length of "PROFILE_" */); } } -- cgit v1.2.1