rcc: eradicate all Q_FOREACH loops

... by replacing them with C++11 ramge-for loops.

Change-Id: I95a91ac36c2b2bef17bf12cf7f1676653a2d807d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
Marc Mutz 2016-01-25 12:23:56 +01:00
parent 956021dbfc
commit 364e3eb680
2 changed files with 6 additions and 5 deletions

View File

@ -49,9 +49,9 @@ QT_BEGIN_NAMESPACE
void dumpRecursive(const QDir &dir, QTextStream &out)
{
QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot
| QDir::NoSymLinks);
foreach (const QFileInfo &entry, entries) {
const QFileInfoList entries = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot
| QDir::NoSymLinks);
for (const QFileInfo &entry : entries) {
if (entry.isDir()) {
dumpRecursive(entry.filePath(), out);
} else {
@ -194,7 +194,7 @@ int runRcc(int argc, char *argv[])
const bool projectRequested = parser.isSet(projectOption);
const QStringList filenamesIn = parser.positionalArguments();
foreach (const QString &file, filenamesIn) {
for (const QString &file : filenamesIn) {
if (file == QLatin1String("-"))
continue;
else if (!QFile::exists(file)) {

View File

@ -612,9 +612,10 @@ bool RCCResourceLibrary::addFile(const QString &alias, const RCCFileInfo &file)
for (ChildConstIterator it = cbegin; it != cend; ++it) {
if (it.key() == filename && it.value()->m_language == s->m_language &&
it.value()->m_country == s->m_country) {
foreach (const QString &name, m_fileNames)
for (const QString &name : qAsConst(m_fileNames)) {
qWarning("%s: Warning: potential duplicate alias detected: '%s'",
qPrintable(name), qPrintable(filename));
}
break;
}
}