forked from qt-creator/qt-creator
plugins: Remove foreach usage
Change-Id: Idf60caed3b5f4ec4c6e990a9e3188487bcc824f8 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
@@ -176,7 +176,7 @@ QString MimeType::comment() const
|
|||||||
QStringList languageList;
|
QStringList languageList;
|
||||||
languageList << QLocale::system().name();
|
languageList << QLocale::system().name();
|
||||||
languageList << QLocale::system().uiLanguages();
|
languageList << QLocale::system().uiLanguages();
|
||||||
Q_FOREACH (const QString &language, languageList) {
|
for (const QString &language : std::as_const(languageList)) {
|
||||||
const QString lang = language == QLatin1String("C") ? QLatin1String("en_US") : language;
|
const QString lang = language == QLatin1String("C") ? QLatin1String("en_US") : language;
|
||||||
const QString comm = d->localeComments.value(lang);
|
const QString comm = d->localeComments.value(lang);
|
||||||
if (!comm.isEmpty())
|
if (!comm.isEmpty())
|
||||||
|
@@ -439,9 +439,9 @@ static void dump()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDebug() << "------- dumping files with watch list";
|
qDebug() << "------- dumping files with watch list";
|
||||||
foreach (IDocument *key, d->m_filesWithWatch.keys()) {
|
const QList<IDocument *> keys = d->m_filesWithWatch.keys()
|
||||||
|
for (IDocument *key : keys)
|
||||||
qDebug() << key->fileName() << d->m_filesWithWatch.value(key);
|
qDebug() << key->fileName() << d->m_filesWithWatch.value(key);
|
||||||
}
|
|
||||||
qDebug() << "------- dumping watch list";
|
qDebug() << "------- dumping watch list";
|
||||||
if (d->m_fileWatcher)
|
if (d->m_fileWatcher)
|
||||||
qDebug() << d->m_fileWatcher->files();
|
qDebug() << d->m_fileWatcher->files();
|
||||||
|
@@ -163,7 +163,7 @@ void LocalSymbolsTest::test()
|
|||||||
LocalSymbols localSymbols(document, functionDefinition);
|
LocalSymbols localSymbols(document, functionDefinition);
|
||||||
|
|
||||||
const QList<Result> actualUses = Result::fromLocalUses(localSymbols.uses);
|
const QList<Result> actualUses = Result::fromLocalUses(localSymbols.uses);
|
||||||
// foreach (const Result &result, actualUses)
|
// for (const Result &result : actualUses)
|
||||||
// qDebug() << QTest::toString(result);
|
// qDebug() << QTest::toString(result);
|
||||||
QCOMPARE(actualUses, expectedUses);
|
QCOMPARE(actualUses, expectedUses);
|
||||||
}
|
}
|
||||||
|
@@ -89,7 +89,7 @@ UseSelectionsTestCase::UseSelectionsTestCase(CppTestDocument &testFile,
|
|||||||
QEXPECT_FAIL("non-local use as macro argument - argument expanded 1", "TODO", Abort);
|
QEXPECT_FAIL("non-local use as macro argument - argument expanded 1", "TODO", Abort);
|
||||||
}
|
}
|
||||||
QVERIFY(!hasTimedOut);
|
QVERIFY(!hasTimedOut);
|
||||||
// foreach (const Selection &selection, selections)
|
// for (const Selection &selection : selections)
|
||||||
// qDebug() << QTest::toString(selection);
|
// qDebug() << QTest::toString(selection);
|
||||||
if (!clangCodeModel)
|
if (!clangCodeModel)
|
||||||
QEXPECT_FAIL("non-local use as macro argument - argument expanded 2", "TODO", Abort);
|
QEXPECT_FAIL("non-local use as macro argument - argument expanded 2", "TODO", Abort);
|
||||||
|
@@ -2998,7 +2998,7 @@ void CdbEngine::handleBreakPoints(const DebuggerResponse &response)
|
|||||||
}
|
}
|
||||||
QTC_ASSERT(false, qDebug() << "bp not found in either of the pending maps");
|
QTC_ASSERT(false, qDebug() << "bp not found in either of the pending maps");
|
||||||
} // not pending reported
|
} // not pending reported
|
||||||
} // foreach
|
} // for
|
||||||
if (m_pendingBreakpointMap.empty())
|
if (m_pendingBreakpointMap.empty())
|
||||||
str << "All breakpoints have been resolved.\n";
|
str << "All breakpoints have been resolved.\n";
|
||||||
else
|
else
|
||||||
|
@@ -115,7 +115,7 @@ TextEditor::IndentationForBlock GlslIndenter::indentationForBlocks(
|
|||||||
codeFormatter.updateStateUntil(blocks.last());
|
codeFormatter.updateStateUntil(blocks.last());
|
||||||
|
|
||||||
TextEditor::IndentationForBlock ret;
|
TextEditor::IndentationForBlock ret;
|
||||||
foreach (QTextBlock block, blocks) {
|
for (const QTextBlock &block : blocks) {
|
||||||
int indent;
|
int indent;
|
||||||
int padding;
|
int padding;
|
||||||
codeFormatter.indentFor(block, &indent, &padding);
|
codeFormatter.indentFor(block, &indent, &padding);
|
||||||
|
@@ -123,7 +123,8 @@ void SubComponentManager::removeImport(int index)
|
|||||||
if (!m_dirToQualifier.contains(canonicalDirPath))
|
if (!m_dirToQualifier.contains(canonicalDirPath))
|
||||||
m_watcher.removePath(canonicalDirPath);
|
m_watcher.removePath(canonicalDirPath);
|
||||||
|
|
||||||
// foreach (const QFileInfo &monitoredFile, watchedFiles(canonicalDirPath)) { ### todo: proper support for import as
|
// const QList<QFileInfo> files = watchedFiles(canonicalDirPath);
|
||||||
|
// for (const QFileInfo &monitoredFile : files) { ### todo: proper support for import as
|
||||||
// if (!m_dirToQualifier.contains(canonicalDirPath))
|
// if (!m_dirToQualifier.contains(canonicalDirPath))
|
||||||
// unregisterQmlFile(monitoredFile, import.qualifier());
|
// unregisterQmlFile(monitoredFile, import.qualifier());
|
||||||
// }
|
// }
|
||||||
|
@@ -161,7 +161,8 @@ QmlBuildSystem::QmlBuildSystem(Target *target)
|
|||||||
// FIXME: Check. Probably bogus after the BuildSystem move.
|
// FIXME: Check. Probably bogus after the BuildSystem move.
|
||||||
// // addedTarget calls updateEnabled on the runconfigurations
|
// // addedTarget calls updateEnabled on the runconfigurations
|
||||||
// // which needs to happen after refresh
|
// // which needs to happen after refresh
|
||||||
// foreach (Target *t, targets())
|
// const QLis<Target> targetList = targets();
|
||||||
|
// for (Target *t : targetList)
|
||||||
// addedTarget(t);
|
// addedTarget(t);
|
||||||
|
|
||||||
connect(target->project(), &Project::activeTargetChanged,
|
connect(target->project(), &Project::activeTargetChanged,
|
||||||
|
@@ -130,7 +130,8 @@ FilePath QnxUtils::envFilePath(const FilePath &sdpPath)
|
|||||||
|
|
||||||
QString QnxUtils::defaultTargetVersion(const QString &sdpPath)
|
QString QnxUtils::defaultTargetVersion(const QString &sdpPath)
|
||||||
{
|
{
|
||||||
foreach (const ConfigInstallInformation &sdpInfo, installedConfigs()) {
|
const QList<ConfigInstallInformation> configs = installedConfigs();
|
||||||
|
for (const ConfigInstallInformation &sdpInfo : configs) {
|
||||||
if (!sdpInfo.path.compare(sdpPath, HostOsInfo::fileNameCaseSensitivity()))
|
if (!sdpInfo.path.compare(sdpPath, HostOsInfo::fileNameCaseSensitivity()))
|
||||||
return sdpInfo.version;
|
return sdpInfo.version;
|
||||||
}
|
}
|
||||||
@@ -146,10 +147,9 @@ QList<ConfigInstallInformation> QnxUtils::installedConfigs(const QString &config
|
|||||||
if (!QDir(sdpConfigPath).exists())
|
if (!QDir(sdpConfigPath).exists())
|
||||||
return sdpList;
|
return sdpList;
|
||||||
|
|
||||||
QFileInfoList sdpfileList =
|
const QFileInfoList sdpfileList
|
||||||
QDir(sdpConfigPath).entryInfoList(QStringList() << QLatin1String("*.xml"),
|
= QDir(sdpConfigPath).entryInfoList(QStringList{"*.xml"}, QDir::Files, QDir::Time);
|
||||||
QDir::Files, QDir::Time);
|
for (const QFileInfo &sdpFile : sdpfileList) {
|
||||||
foreach (const QFileInfo &sdpFile, sdpfileList) {
|
|
||||||
QFile xmlFile(sdpFile.absoluteFilePath());
|
QFile xmlFile(sdpFile.absoluteFilePath());
|
||||||
if (!xmlFile.open(QIODevice::ReadOnly))
|
if (!xmlFile.open(QIODevice::ReadOnly))
|
||||||
continue;
|
continue;
|
||||||
|
@@ -131,7 +131,7 @@ QString ExamplesWelcomePage::copyToAlternativeLocation(const QFileInfo& proFileI
|
|||||||
for (QStringList::Iterator it = filesToOpen.begin(); it != end; ++it)
|
for (QStringList::Iterator it = filesToOpen.begin(); it != end; ++it)
|
||||||
it->replace(projectDir, targetDir);
|
it->replace(projectDir, targetDir);
|
||||||
|
|
||||||
foreach (const QString &dependency, dependencies) {
|
for (const QString &dependency : dependencies) {
|
||||||
const FilePath targetFile = FilePath::fromString(targetDir)
|
const FilePath targetFile = FilePath::fromString(targetDir)
|
||||||
.pathAppended(QDir(dependency).dirName());
|
.pathAppended(QDir(dependency).dirName());
|
||||||
if (!FileUtils::copyRecursively(FilePath::fromString(dependency), targetFile,
|
if (!FileUtils::copyRecursively(FilePath::fromString(dependency), targetFile,
|
||||||
|
@@ -86,7 +86,7 @@ ProFileReader::ProFileReader(QMakeGlobals *option, QMakeVfs *vfs)
|
|||||||
|
|
||||||
ProFileReader::~ProFileReader()
|
ProFileReader::~ProFileReader()
|
||||||
{
|
{
|
||||||
foreach (ProFile *pf, m_proFiles)
|
for (ProFile *pf : std::as_const(m_proFiles))
|
||||||
pf->deref();
|
pf->deref();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -33,7 +33,8 @@ QScxmlcGenerator::QScxmlcGenerator(const Project *project,
|
|||||||
Tasks QScxmlcGenerator::parseIssues(const QByteArray &processStderr)
|
Tasks QScxmlcGenerator::parseIssues(const QByteArray &processStderr)
|
||||||
{
|
{
|
||||||
Tasks issues;
|
Tasks issues;
|
||||||
foreach (const QByteArray &line, processStderr.split('\n')) {
|
const QList<QByteArray> lines = processStderr.split('\n');
|
||||||
|
for (const QByteArray &line : lines) {
|
||||||
QByteArrayList tokens = line.split(':');
|
QByteArrayList tokens = line.split(':');
|
||||||
|
|
||||||
if (tokens.length() > 4) {
|
if (tokens.length() > 4) {
|
||||||
|
@@ -459,9 +459,10 @@ void BookmarkWidget::setup()
|
|||||||
void BookmarkWidget::expandItems()
|
void BookmarkWidget::expandItems()
|
||||||
{
|
{
|
||||||
QStandardItemModel *model = bookmarkManager->treeBookmarkModel();
|
QStandardItemModel *model = bookmarkManager->treeBookmarkModel();
|
||||||
QList<QStandardItem*>list = model->findItems(QLatin1String("*"),
|
const QList<QStandardItem *> list = model->findItems(QLatin1String("*"),
|
||||||
Qt::MatchWildcard | Qt::MatchRecursive, 0);
|
Qt::MatchWildcard | Qt::MatchRecursive,
|
||||||
foreach (const QStandardItem* item, list) {
|
0);
|
||||||
|
for (const QStandardItem *item : list) {
|
||||||
const QModelIndex& index = model->indexFromItem(item);
|
const QModelIndex& index = model->indexFromItem(item);
|
||||||
treeView->setExpanded(filterBookmarkModel->mapFromSource(index),
|
treeView->setExpanded(filterBookmarkModel->mapFromSource(index),
|
||||||
item->data(Qt::UserRole + 11).toBool());
|
item->data(Qt::UserRole + 11).toBool());
|
||||||
@@ -604,11 +605,12 @@ QStringList BookmarkManager::bookmarkFolders() const
|
|||||||
{
|
{
|
||||||
QStringList folders(tr("Bookmarks"));
|
QStringList folders(tr("Bookmarks"));
|
||||||
|
|
||||||
QList<QStandardItem*>list = treeModel->findItems(QLatin1String("*"),
|
const QList<QStandardItem *> list = treeModel->findItems(QLatin1String("*"),
|
||||||
Qt::MatchWildcard | Qt::MatchRecursive, 0);
|
Qt::MatchWildcard | Qt::MatchRecursive,
|
||||||
|
0);
|
||||||
|
|
||||||
QString data;
|
QString data;
|
||||||
foreach (const QStandardItem *item, list) {
|
for (const QStandardItem *item : list) {
|
||||||
data = item->data(Qt::UserRole + 10).toString();
|
data = item->data(Qt::UserRole + 10).toString();
|
||||||
if (data == QLatin1String("Folder"))
|
if (data == QLatin1String("Folder"))
|
||||||
folders << item->data(Qt::DisplayRole).toString();
|
folders << item->data(Qt::DisplayRole).toString();
|
||||||
@@ -649,8 +651,8 @@ void BookmarkManager::removeBookmarkItem(QTreeView *treeView,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (data != QLatin1String("Folder")) {
|
if (data != QLatin1String("Folder")) {
|
||||||
QList<QStandardItem*>itemList = listModel->findItems(item->text());
|
const QList<QStandardItem *> itemList = listModel->findItems(item->text());
|
||||||
foreach (const QStandardItem *i, itemList) {
|
for (const QStandardItem *i : itemList) {
|
||||||
if (i->data(Qt::UserRole + 10) == data) {
|
if (i->data(Qt::UserRole + 10) == data) {
|
||||||
listModel->removeRow(i->row());
|
listModel->removeRow(i->row());
|
||||||
break;
|
break;
|
||||||
@@ -754,11 +756,12 @@ void BookmarkManager::setupBookmarkModels()
|
|||||||
QString BookmarkManager::uniqueFolderName() const
|
QString BookmarkManager::uniqueFolderName() const
|
||||||
{
|
{
|
||||||
QString folderName = tr("New Folder");
|
QString folderName = tr("New Folder");
|
||||||
QList<QStandardItem*> list = treeModel->findItems(folderName,
|
const QList<QStandardItem *> list = treeModel->findItems(folderName,
|
||||||
Qt::MatchContains | Qt::MatchRecursive, 0);
|
Qt::MatchContains | Qt::MatchRecursive,
|
||||||
|
0);
|
||||||
if (!list.isEmpty()) {
|
if (!list.isEmpty()) {
|
||||||
QStringList names;
|
QStringList names;
|
||||||
foreach (const QStandardItem *item, list)
|
for (const QStandardItem *item : list)
|
||||||
names << item->text();
|
names << item->text();
|
||||||
|
|
||||||
QString folderNameBase = tr("New Folder") + QLatin1String(" %1");
|
QString folderNameBase = tr("New Folder") + QLatin1String(" %1");
|
||||||
@@ -779,8 +782,8 @@ void BookmarkManager::removeBookmarkFolderItems(QStandardItem *item)
|
|||||||
removeBookmarkFolderItems(child);
|
removeBookmarkFolderItems(child);
|
||||||
|
|
||||||
QString data = child->data(Qt::UserRole + 10).toString();
|
QString data = child->data(Qt::UserRole + 10).toString();
|
||||||
QList<QStandardItem*>itemList = listModel->findItems(child->text());
|
const QList<QStandardItem*> itemList = listModel->findItems(child->text());
|
||||||
foreach (const QStandardItem *i, itemList) {
|
for (const QStandardItem *i : itemList) {
|
||||||
if (i->data(Qt::UserRole + 10) == data) {
|
if (i->data(Qt::UserRole + 10) == data) {
|
||||||
listModel->removeRow(i->row());
|
listModel->removeRow(i->row());
|
||||||
break;
|
break;
|
||||||
|
@@ -62,7 +62,8 @@ QVector<ProFileEvaluator::SourceFile> ProFileEvaluator::fixifiedValues(
|
|||||||
bool expandWildcards) const
|
bool expandWildcards) const
|
||||||
{
|
{
|
||||||
QVector<SourceFile> result;
|
QVector<SourceFile> result;
|
||||||
foreach (const ProString &str, d->values(ProKey(variable))) {
|
const ProStringList values = d->values(ProKey(variable));
|
||||||
|
for (const ProString &str : values) {
|
||||||
const QString &el = d->m_option->expandEnvVars(str.toQString());
|
const QString &el = d->m_option->expandEnvVars(str.toQString());
|
||||||
const QString fn = IoUtils::isAbsolutePath(el)
|
const QString fn = IoUtils::isAbsolutePath(el)
|
||||||
? QDir::cleanPath(el) : QDir::cleanPath(baseDirectory + QLatin1Char('/') + el);
|
? QDir::cleanPath(el) : QDir::cleanPath(baseDirectory + QLatin1Char('/') + el);
|
||||||
@@ -115,7 +116,8 @@ QStringList ProFileEvaluator::absolutePathValues(
|
|||||||
const QString &variable, const QString &baseDirectory) const
|
const QString &variable, const QString &baseDirectory) const
|
||||||
{
|
{
|
||||||
QStringList result;
|
QStringList result;
|
||||||
foreach (const QString &el, values(variable)) {
|
const QStringList valueList = values(variable);
|
||||||
|
for (const QString &el : valueList) {
|
||||||
QString absEl = IoUtils::resolvePath(baseDirectory, el);
|
QString absEl = IoUtils::resolvePath(baseDirectory, el);
|
||||||
if (IoUtils::fileType(absEl) == IoUtils::FileIsDir)
|
if (IoUtils::fileType(absEl) == IoUtils::FileIsDir)
|
||||||
result << absEl;
|
result << absEl;
|
||||||
@@ -129,7 +131,8 @@ QVector<ProFileEvaluator::SourceFile> ProFileEvaluator::absoluteFileValues(
|
|||||||
{
|
{
|
||||||
QMakeVfs::VfsFlags flags = (d->m_cumulative ? QMakeVfs::VfsCumulative : QMakeVfs::VfsExact);
|
QMakeVfs::VfsFlags flags = (d->m_cumulative ? QMakeVfs::VfsCumulative : QMakeVfs::VfsExact);
|
||||||
QVector<SourceFile> result;
|
QVector<SourceFile> result;
|
||||||
foreach (const ProString &str, d->values(ProKey(variable))) {
|
const ProStringList values = d->values(ProKey(variable));
|
||||||
|
for (const ProString &str : values) {
|
||||||
bool &seen = (*handled)[str];
|
bool &seen = (*handled)[str];
|
||||||
if (seen)
|
if (seen)
|
||||||
continue;
|
continue;
|
||||||
@@ -144,7 +147,7 @@ QVector<ProFileEvaluator::SourceFile> ProFileEvaluator::absoluteFileValues(
|
|||||||
}
|
}
|
||||||
absEl = fn;
|
absEl = fn;
|
||||||
} else {
|
} else {
|
||||||
foreach (const QString &dir, searchDirs) {
|
for (const QString &dir : searchDirs) {
|
||||||
QString fn = QDir::cleanPath(dir + QLatin1Char('/') + el);
|
QString fn = QDir::cleanPath(dir + QLatin1Char('/') + el);
|
||||||
if (m_vfs->exists(fn, flags)) {
|
if (m_vfs->exists(fn, flags)) {
|
||||||
result << SourceFile{fn, str.sourceFile()};
|
result << SourceFile{fn, str.sourceFile()};
|
||||||
@@ -169,7 +172,8 @@ QVector<ProFileEvaluator::SourceFile> ProFileEvaluator::absoluteFileValues(
|
|||||||
wildcard.detach(); // Keep m_tmp out of QRegExp's cache
|
wildcard.detach(); // Keep m_tmp out of QRegExp's cache
|
||||||
QDir theDir(absDir);
|
QDir theDir(absDir);
|
||||||
theDir.setFilter(theDir.filter() & ~QDir::AllDirs);
|
theDir.setFilter(theDir.filter() & ~QDir::AllDirs);
|
||||||
foreach (const QString &fn, theDir.entryList(QStringList(wildcard)))
|
const QStringList list = theDir.entryList(QStringList(wildcard));
|
||||||
|
for (const QString &fn : list)
|
||||||
if (fn != QLatin1String(".") && fn != QLatin1String(".."))
|
if (fn != QLatin1String(".") && fn != QLatin1String(".."))
|
||||||
result << SourceFile{absDir + QLatin1Char('/') + fn, str.sourceFile()};
|
result << SourceFile{absDir + QLatin1Char('/') + fn, str.sourceFile()};
|
||||||
QString directoryWithWildcard(absDir);
|
QString directoryWithWildcard(absDir);
|
||||||
|
@@ -546,7 +546,7 @@ void QMakeEvaluator::populateDeps(
|
|||||||
if (depends.isEmpty()) {
|
if (depends.isEmpty()) {
|
||||||
rootSet.insert(first(ProKey(prefix + item + priosfx)).toInt(), item);
|
rootSet.insert(first(ProKey(prefix + item + priosfx)).toInt(), item);
|
||||||
} else {
|
} else {
|
||||||
foreach (const ProString &dep, depends) {
|
for (const ProString &dep : std::as_const(depends)) {
|
||||||
dset.insert(dep.toKey());
|
dset.insert(dep.toKey());
|
||||||
dependees[dep.toKey()] << item;
|
dependees[dep.toKey()] << item;
|
||||||
}
|
}
|
||||||
@@ -699,7 +699,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
evalError(fL1S("num_add(num, ...) requires at least one argument."));
|
evalError(fL1S("num_add(num, ...) requires at least one argument."));
|
||||||
} else {
|
} else {
|
||||||
qlonglong sum = 0;
|
qlonglong sum = 0;
|
||||||
foreach (const ProString &arg, args) {
|
for (const ProString &arg : args) {
|
||||||
if (arg.contains(QLatin1Char('.'))) {
|
if (arg.contains(QLatin1Char('.'))) {
|
||||||
evalError(fL1S("num_add(): floats are currently not supported."));
|
evalError(fL1S("num_add(): floats are currently not supported."));
|
||||||
goto nafail;
|
goto nafail;
|
||||||
@@ -1174,7 +1174,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
rootSet.erase(it);
|
rootSet.erase(it);
|
||||||
if ((func_t == E_RESOLVE_DEPENDS) || orgList.contains(item))
|
if ((func_t == E_RESOLVE_DEPENDS) || orgList.contains(item))
|
||||||
ret.prepend(item);
|
ret.prepend(item);
|
||||||
foreach (const ProString &dep, dependees[item.toKey()]) {
|
for (const ProString &dep : std::as_const(dependees[item.toKey()])) {
|
||||||
QSet<ProKey> &dset = dependencies[dep.toKey()];
|
QSet<ProKey> &dset = dependencies[dep.toKey()];
|
||||||
dset.remove(item.toKey());
|
dset.remove(item.toKey());
|
||||||
if (dset.isEmpty())
|
if (dset.isEmpty())
|
||||||
@@ -1185,11 +1185,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
|
|||||||
break;
|
break;
|
||||||
case E_ENUMERATE_VARS: {
|
case E_ENUMERATE_VARS: {
|
||||||
QSet<ProString> keys;
|
QSet<ProString> keys;
|
||||||
foreach (const ProValueMap &vmap, m_valuemapStack)
|
for (const ProValueMap &vmap : std::as_const(m_valuemapStack))
|
||||||
for (ProValueMap::ConstIterator it = vmap.constBegin(); it != vmap.constEnd(); ++it)
|
for (ProValueMap::ConstIterator it = vmap.constBegin(); it != vmap.constEnd(); ++it)
|
||||||
keys.insert(it.key());
|
keys.insert(it.key());
|
||||||
ret.reserve(keys.size());
|
ret.reserve(keys.size());
|
||||||
foreach (const ProString &key, keys)
|
for (const ProString &key : std::as_const(keys))
|
||||||
ret << key;
|
ret << key;
|
||||||
break; }
|
break; }
|
||||||
case E_SHADOWED:
|
case E_SHADOWED:
|
||||||
|
@@ -1231,7 +1231,7 @@ bool QMakeEvaluator::loadSpec()
|
|||||||
qmakespec = m_hostBuild ? QLatin1String("default-host") : QLatin1String("default");
|
qmakespec = m_hostBuild ? QLatin1String("default-host") : QLatin1String("default");
|
||||||
#endif
|
#endif
|
||||||
if (IoUtils::isRelativePath(qmakespec)) {
|
if (IoUtils::isRelativePath(qmakespec)) {
|
||||||
foreach (const QString &root, m_mkspecPaths) {
|
for (const QString &root : std::as_const(m_mkspecPaths)) {
|
||||||
QString mkspec = root + QLatin1Char('/') + qmakespec;
|
QString mkspec = root + QLatin1Char('/') + qmakespec;
|
||||||
if (IoUtils::exists(mkspec)) {
|
if (IoUtils::exists(mkspec)) {
|
||||||
qmakespec = mkspec;
|
qmakespec = mkspec;
|
||||||
@@ -1472,7 +1472,7 @@ void QMakeEvaluator::updateMkspecPaths()
|
|||||||
for (const QString &it : paths)
|
for (const QString &it : paths)
|
||||||
ret << it + concat;
|
ret << it + concat;
|
||||||
|
|
||||||
foreach (const QString &it, m_qmakepath)
|
for (const QString &it : std::as_const(m_qmakepath))
|
||||||
ret << it + concat;
|
ret << it + concat;
|
||||||
|
|
||||||
if (!m_buildRoot.isEmpty())
|
if (!m_buildRoot.isEmpty())
|
||||||
@@ -1514,7 +1514,7 @@ void QMakeEvaluator::updateFeaturePaths()
|
|||||||
for (const QString &item : items)
|
for (const QString &item : items)
|
||||||
feature_bases << (item + mkspecs_concat);
|
feature_bases << (item + mkspecs_concat);
|
||||||
|
|
||||||
foreach (const QString &item, m_qmakepath)
|
for (const QString &item : std::as_const(m_qmakepath))
|
||||||
feature_bases << (item + mkspecs_concat);
|
feature_bases << (item + mkspecs_concat);
|
||||||
|
|
||||||
if (!m_qmakespec.isEmpty()) {
|
if (!m_qmakespec.isEmpty()) {
|
||||||
@@ -1536,7 +1536,7 @@ void QMakeEvaluator::updateFeaturePaths()
|
|||||||
feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + mkspecs_concat);
|
feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/get")) + mkspecs_concat);
|
||||||
feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/src")) + mkspecs_concat);
|
feature_bases << (m_option->propertyValue(ProKey("QT_HOST_DATA/src")) + mkspecs_concat);
|
||||||
|
|
||||||
foreach (const QString &fb, feature_bases) {
|
for (const QString &fb : std::as_const(feature_bases)) {
|
||||||
const auto sfxs = values(ProKey("QMAKE_PLATFORM"));
|
const auto sfxs = values(ProKey("QMAKE_PLATFORM"));
|
||||||
for (const ProString &sfx : sfxs)
|
for (const ProString &sfx : sfxs)
|
||||||
feature_roots << (fb + features_concat + sfx + QLatin1Char('/'));
|
feature_roots << (fb + features_concat + sfx + QLatin1Char('/'));
|
||||||
@@ -1550,7 +1550,7 @@ void QMakeEvaluator::updateFeaturePaths()
|
|||||||
feature_roots.removeDuplicates();
|
feature_roots.removeDuplicates();
|
||||||
|
|
||||||
QStringList ret;
|
QStringList ret;
|
||||||
foreach (const QString &root, feature_roots)
|
for (const QString &root : std::as_const(feature_roots))
|
||||||
if (IoUtils::exists(root))
|
if (IoUtils::exists(root))
|
||||||
ret << root;
|
ret << root;
|
||||||
m_featureRoots = new QMakeFeatureRoots(ret);
|
m_featureRoots = new QMakeFeatureRoots(ret);
|
||||||
|
@@ -168,7 +168,7 @@ void QMakeGlobals::commitCommandLineArguments(QMakeCmdLineParserState &state)
|
|||||||
{
|
{
|
||||||
if (!state.extraargs.isEmpty()) {
|
if (!state.extraargs.isEmpty()) {
|
||||||
QString extra = fL1S("QMAKE_EXTRA_ARGS =");
|
QString extra = fL1S("QMAKE_EXTRA_ARGS =");
|
||||||
foreach (const QString &ea, state.extraargs)
|
for (const QString &ea : std::as_const(state.extraargs))
|
||||||
extra += QLatin1Char(' ') + QMakeEvaluator::quoteValue(ProString(ea));
|
extra += QLatin1Char(' ') + QMakeEvaluator::quoteValue(ProString(ea));
|
||||||
state.cmds[QMakeEvalBefore] << extra;
|
state.cmds[QMakeEvalBefore] << extra;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user