forked from qt-creator/qt-creator
Replace missing qAsConst with std::as_const()
Patch missing leftovers after recent batch patch.
Amends 8eb4d52342
Change-Id: I5469b8c10e6844cd1911f719ce3dddbb42697f95
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -258,7 +258,7 @@ void AbstractSettings::save()
|
||||
return;
|
||||
|
||||
// remove old files and possible subfolder
|
||||
for (const QString &key : qAsConst(m_stylesToRemove)) {
|
||||
for (const QString &key : std::as_const(m_stylesToRemove)) {
|
||||
const QFileInfo fi(styleFileName(key));
|
||||
QFile::remove(fi.absoluteFilePath());
|
||||
if (fi.absoluteDir() != m_styleDir)
|
||||
|
@@ -748,7 +748,7 @@ QString BookmarkManager::bookmarkToString(const Bookmark *b)
|
||||
void BookmarkManager::saveBookmarks()
|
||||
{
|
||||
QStringList list;
|
||||
for (const Bookmark *bookmark : qAsConst(m_bookmarksList))
|
||||
for (const Bookmark *bookmark : std::as_const(m_bookmarksList))
|
||||
list << bookmarkToString(bookmark);
|
||||
|
||||
SessionManager::setValue(QLatin1String("Bookmarks"), list);
|
||||
|
@@ -259,7 +259,7 @@ bool IOptionsPage::matches(const QRegularExpression ®exp) const
|
||||
|
||||
m_keywordsInitialized = true;
|
||||
}
|
||||
for (const QString &keyword : qAsConst(m_keywords))
|
||||
for (const QString &keyword : std::as_const(m_keywords))
|
||||
if (keyword.contains(regexp))
|
||||
return true;
|
||||
return false;
|
||||
|
@@ -6070,13 +6070,13 @@ bool FakeVimHandler::Private::handleExMapCommand(const ExCommand &cmd0) // :map
|
||||
//qDebug() << "MAPPING: " << modes << lhs << rhs;
|
||||
switch (type) {
|
||||
case Unmap:
|
||||
for (char c : qAsConst(modes))
|
||||
for (char c : std::as_const(modes))
|
||||
MappingsIterator(&g.mappings, c, key).remove();
|
||||
break;
|
||||
case Map: Q_FALLTHROUGH();
|
||||
case Noremap: {
|
||||
const Inputs inputs(rhs, type == Noremap, silent);
|
||||
for (char c : qAsConst(modes))
|
||||
for (char c : std::as_const(modes))
|
||||
MappingsIterator(&g.mappings, c).setInputs(key, inputs, unique);
|
||||
break;
|
||||
}
|
||||
|
@@ -250,7 +250,7 @@ void DocSettingsPageWidget::addDocumentation()
|
||||
QSet<QString> values = Utils::toSet(m_filesToUnregister.values(nameSpace));
|
||||
values.remove(filePath);
|
||||
m_filesToUnregister.remove(nameSpace);
|
||||
for (const QString &value : qAsConst(values))
|
||||
for (const QString &value : std::as_const(values))
|
||||
m_filesToUnregister.insert(nameSpace, value);
|
||||
}
|
||||
}
|
||||
|
@@ -425,7 +425,7 @@ void GeneralSettingsPage::updateFontSizeSelector()
|
||||
// try to maintain selection or select closest.
|
||||
if (!pointSizes.empty()) {
|
||||
QString n;
|
||||
for (int pointSize : qAsConst(pointSizes))
|
||||
for (int pointSize : std::as_const(pointSizes))
|
||||
m_widget->sizeComboBox->addItem(n.setNum(pointSize), QVariant(pointSize));
|
||||
const int closestIndex = closestPointSizeIndex(m_font.pointSize());
|
||||
if (closestIndex != -1)
|
||||
|
@@ -181,7 +181,7 @@ Kit *QbsProjectImporter::createKit(void *directoryData) const
|
||||
tcData << findOrCreateToolChains({bgData->cxxCompilerPath, Constants::CXX_LANGUAGE_ID});
|
||||
if (!bgData->cCompilerPath.isEmpty())
|
||||
tcData << findOrCreateToolChains({bgData->cCompilerPath, Constants::C_LANGUAGE_ID});
|
||||
for (const ToolChainData &tc : qAsConst(tcData)) {
|
||||
for (const ToolChainData &tc : std::as_const(tcData)) {
|
||||
if (!tc.tcs.isEmpty())
|
||||
ToolChainKitAspect::setToolChain(k, tc.tcs.first());
|
||||
}
|
||||
|
@@ -247,7 +247,7 @@ QList<Core::GeneratedFile> PluginGenerator::generatePlugin(const GenerationPara
|
||||
// Copy icons that are not in the plugin source base directory yet (that is,
|
||||
// probably all), add them to the resource file
|
||||
QString iconFiles;
|
||||
for (QString icon : qAsConst(pluginIcons)) {
|
||||
for (QString icon : std::as_const(pluginIcons)) {
|
||||
const QFileInfo qfi(icon);
|
||||
if (qfi.dir() != slashLessBaseDir) {
|
||||
const QString newIcon = baseDir + qfi.fileName();
|
||||
|
@@ -348,7 +348,7 @@ void MakeFileParse::parseCommandLine(const QString &command, const QString &proj
|
||||
ProcessArgs::addArg(&m_unparsedArguments, qa.variable + qa.op + qa.value);
|
||||
if (!afterAssignments.isEmpty()) {
|
||||
ProcessArgs::addArg(&m_unparsedArguments, QLatin1String("-after"));
|
||||
for (const QMakeAssignment &qa : qAsConst(afterAssignments))
|
||||
for (const QMakeAssignment &qa : std::as_const(afterAssignments))
|
||||
ProcessArgs::addArg(&m_unparsedArguments, qa.variable + qa.op + qa.value);
|
||||
}
|
||||
}
|
||||
|
@@ -276,7 +276,7 @@ void QmakeBuildConfiguration::updateProblemLabel()
|
||||
|
||||
if (!issues.isEmpty()) {
|
||||
QString text = QLatin1String("<nobr>");
|
||||
for (const ProjectExplorer::Task &task : qAsConst(issues)) {
|
||||
for (const ProjectExplorer::Task &task : std::as_const(issues)) {
|
||||
QString type;
|
||||
switch (task.type) {
|
||||
case ProjectExplorer::Task::Error:
|
||||
|
@@ -281,7 +281,7 @@ void QmakePriFile::extractSources(
|
||||
QHash<int, QmakePriFileEvalResult *> proToResult, QmakePriFileEvalResult *fallback,
|
||||
QVector<ProFileEvaluator::SourceFile> sourceFiles, FileType type, bool cumulative)
|
||||
{
|
||||
for (const ProFileEvaluator::SourceFile &source : qAsConst(sourceFiles)) {
|
||||
for (const ProFileEvaluator::SourceFile &source : std::as_const(sourceFiles)) {
|
||||
auto *result = proToResult.value(source.proFileId);
|
||||
if (!result)
|
||||
result = fallback;
|
||||
@@ -447,7 +447,7 @@ bool QmakePriFile::deploysFolder(const QString &folder) const
|
||||
if (!f.endsWith(slash))
|
||||
f.append(slash);
|
||||
|
||||
for (const QString &wf : qAsConst(m_watchedFolders)) {
|
||||
for (const QString &wf : std::as_const(m_watchedFolders)) {
|
||||
if (f.startsWith(wf)
|
||||
&& (wf.endsWith(slash)
|
||||
|| (wf.length() < f.length() && f.at(wf.length()) == slash)))
|
||||
@@ -1644,7 +1644,7 @@ void QmakeProFile::applyEvaluate(const QmakeEvalResultPtr &result)
|
||||
return;
|
||||
}
|
||||
|
||||
for (const QString &error : qAsConst(result->errors))
|
||||
for (const QString &error : std::as_const(result->errors))
|
||||
QmakeBuildSystem::proFileParseError(error, filePath());
|
||||
|
||||
// we are changing what is executed in that case
|
||||
|
@@ -718,7 +718,7 @@ void QmakeBuildSystem::asyncUpdate()
|
||||
project()->updateExtraProjectFiles(docUpdater);
|
||||
rootProFile()->asyncUpdate();
|
||||
} else {
|
||||
for (QmakeProFile *file : qAsConst(m_partialEvaluate))
|
||||
for (QmakeProFile *file : std::as_const(m_partialEvaluate))
|
||||
file->asyncUpdate();
|
||||
}
|
||||
|
||||
@@ -1024,7 +1024,7 @@ void CentralizedFolderWatcher::unwatchFolders(const QList<QString> &folders, Qma
|
||||
// where a given directory watcher actual comes from...
|
||||
|
||||
QStringList toRemove;
|
||||
for (const QString &rwf : qAsConst(m_recursiveWatchedFolders)) {
|
||||
for (const QString &rwf : std::as_const(m_recursiveWatchedFolders)) {
|
||||
if (rwf.startsWith(folder)) {
|
||||
// So the rwf is a subdirectory of a folder we aren't watching
|
||||
// but maybe someone else wants us to watch
|
||||
@@ -1043,7 +1043,7 @@ void CentralizedFolderWatcher::unwatchFolders(const QList<QString> &folders, Qma
|
||||
}
|
||||
}
|
||||
|
||||
for (const QString &tr : qAsConst(toRemove))
|
||||
for (const QString &tr : std::as_const(toRemove))
|
||||
m_recursiveWatchedFolders.remove(tr);
|
||||
}
|
||||
}
|
||||
@@ -1056,7 +1056,7 @@ void CentralizedFolderWatcher::folderChanged(const QString &folder)
|
||||
|
||||
void CentralizedFolderWatcher::onTimer()
|
||||
{
|
||||
for (const QString &folder : qAsConst(m_changedFolders))
|
||||
for (const QString &folder : std::as_const(m_changedFolders))
|
||||
delayedFolderChanged(folder);
|
||||
m_changedFolders.clear();
|
||||
}
|
||||
|
@@ -356,7 +356,7 @@ bool ResourceFile::renameFile(const QString &fileName, const QString &newFileNam
|
||||
|
||||
entries.at(0)->checkExistence();
|
||||
if (entries.at(0)->exists()) {
|
||||
for (File *file : qAsConst(entries))
|
||||
for (File *file : std::as_const(entries))
|
||||
file->setExists(true);
|
||||
success = Core::FileUtils::renameFile(Utils::FilePath::fromString(entries.at(0)->name),
|
||||
Utils::FilePath::fromString(newFileName));
|
||||
@@ -364,7 +364,7 @@ bool ResourceFile::renameFile(const QString &fileName, const QString &newFileNam
|
||||
|
||||
if (success) {
|
||||
const bool exists = QFile::exists(newFileName);
|
||||
for (File *file : qAsConst(entries)) {
|
||||
for (File *file : std::as_const(entries)) {
|
||||
file->name = newFileName;
|
||||
file->setExists(exists);
|
||||
}
|
||||
@@ -715,7 +715,7 @@ bool ResourceModel::iconFileExtension(const QString &path)
|
||||
}
|
||||
}
|
||||
|
||||
for (const QString &ext : qAsConst(ext_list)) {
|
||||
for (const QString &ext : std::as_const(ext_list)) {
|
||||
if (path.endsWith(ext, Qt::CaseInsensitive))
|
||||
return true;
|
||||
}
|
||||
|
@@ -321,7 +321,7 @@ void ResourceTopLevelNode::addInternalNodes()
|
||||
QString parentFolderName;
|
||||
PrefixFolderLang folderId(prefix, QString(), lang);
|
||||
QStringList currentPathList;
|
||||
for (const QString &pathElement : qAsConst(pathList)) {
|
||||
for (const QString &pathElement : std::as_const(pathList)) {
|
||||
currentPathList << pathElement;
|
||||
const QString folderName = currentPathList.join(QLatin1Char('/'));
|
||||
folderId = PrefixFolderLang(prefix, folderName, lang);
|
||||
|
@@ -47,7 +47,7 @@ TodoItemsModel *TodoItemsProvider::todoItemsModel()
|
||||
void TodoItemsProvider::settingsChanged(const Settings &newSettings)
|
||||
{
|
||||
if (newSettings.keywords != m_settings.keywords) {
|
||||
for (TodoItemsScanner *scanner : qAsConst(m_scanners))
|
||||
for (TodoItemsScanner *scanner : std::as_const(m_scanners))
|
||||
scanner->setParams(newSettings.keywords);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ void TodoItemsProvider::createScanners()
|
||||
if (QmlJS::ModelManagerInterface::instance())
|
||||
m_scanners << new QmlJsTodoItemsScanner(m_settings.keywords, this);
|
||||
|
||||
for (TodoItemsScanner *scanner : qAsConst(m_scanners)) {
|
||||
for (TodoItemsScanner *scanner : std::as_const(m_scanners)) {
|
||||
connect(scanner, &TodoItemsScanner::itemsFetched, this,
|
||||
&TodoItemsProvider::itemsFetched, Qt::QueuedConnection);
|
||||
}
|
||||
|
Reference in New Issue
Block a user