cleanup: replace Q_FOREACH and foreach by range base for

Q_FOREACH and foreach are anachronisms.

Range based for may cause a performance regression: it can
lead to a copy of shared containers (one reason why Qt's
COW containers are broken). However, as long as there is no
user noticeable delay, there is no point in analyzing each case.
And also no point in slapping an 'asConst' on every container
that is looped over.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-03-16 16:50:43 +01:00 committed by bstoeger
parent 41cb916060
commit 5ac64ab2cd
16 changed files with 32 additions and 35 deletions

View file

@ -55,7 +55,7 @@ void set_bundled_templates_as_read_only()
listStats[i] = stats + QDir::separator() + listStats.at(i);
list += listStats;
foreach (const QString& f, list)
for (const QString &f: list)
QFile::setPermissions(pathUser + QDir::separator() + f, QFileDevice::ReadOwner | QFileDevice::ReadUser);
}