diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2021-02-23 00:37:11 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2021-03-06 01:35:08 +0200 |
commit | 9d87348260316af729892c58bc29f159a173abf1 (patch) | |
tree | af81edda4bf441239f4ccc66dbfb533c5be26a47 /src/core/kemailsettings.cpp | |
parent | ee35bdce8f6b08922b4c9e0c0c838e5f2c4a79ad (diff) | |
download | kconfig-9d87348260316af729892c58bc29f159a173abf1.tar.gz kconfig-9d87348260316af729892c58bc29f159a173abf1.tar.bz2 |
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
Diffstat (limited to 'src/core/kemailsettings.cpp')
-rw-r--r-- | src/core/kemailsettings.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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_" */); } } |