forked from qt-creator/qt-creator
Utils: Purge asConst
Replace by qAsConst. Change-Id: I3301366f73c066c86f08df7188d70dc3b613c55c Reviewed-by: Christian Stenger <christian.stenger@qt.io> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
11336fb604
commit
7d3a79c696
@@ -38,7 +38,6 @@
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/target.h>
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/categorysortfiltermodel.h>
|
||||
#include <utils/detailswidget.h>
|
||||
#include <utils/fancylineedit.h>
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
#include <qmljs/qmljsmodelmanagerinterface.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/stringutils.h>
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
|
||||
#include "configmodel.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/theme/theme.h>
|
||||
@@ -344,7 +343,7 @@ void ConfigModel::generateTree()
|
||||
|
||||
Utils::TreeItem *root = new Utils::TreeItem;
|
||||
|
||||
for (const QString &p : Utils::asConst(prefixList)) {
|
||||
for (const QString &p : qAsConst(prefixList)) {
|
||||
const QList<Utils::TreeItem *> &prefixItemList = prefixes.value(p);
|
||||
QTC_ASSERT(!prefixItemList.isEmpty(), continue);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "configmodelitemdelegate.h"
|
||||
#include "configmodel.h"
|
||||
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/pathchooser.h>
|
||||
|
||||
#include <QComboBox>
|
||||
@@ -56,7 +55,7 @@ QWidget *ConfigModelItemDelegate::createEditor(QWidget *parent, const QStyleOpti
|
||||
} else if (!data.values.isEmpty()) {
|
||||
auto edit = new QComboBox(parent);
|
||||
edit->setFocusPolicy(Qt::StrongFocus);
|
||||
for (const QString &s : Utils::asConst(data.values))
|
||||
for (const QString &s : qAsConst(data.values))
|
||||
edit->addItem(s);
|
||||
return edit;
|
||||
} else if (data.type == ConfigModel::DataItem::BOOLEAN) {
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#include <projectexplorer/taskhub.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/asconst.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
@@ -352,7 +351,7 @@ void ServerModeReader::generateProjectTree(CMakeProjectNode *root,
|
||||
void ServerModeReader::updateCodeModel(CppTools::RawProjectParts &rpps)
|
||||
{
|
||||
int counter = 0;
|
||||
for (const FileGroup *fg : Utils::asConst(m_fileGroups)) {
|
||||
for (const FileGroup *fg : qAsConst(m_fileGroups)) {
|
||||
++counter;
|
||||
const QStringList flags = QtcProcess::splitArgs(fg->compileFlags);
|
||||
const QStringList includes = transform(fg->includePaths, [](const IncludePath *ip) { return ip->path.toString(); });
|
||||
@@ -679,7 +678,7 @@ void ServerModeReader::fixTarget(ServerModeReader::Target *target) const
|
||||
{
|
||||
QHash<QString, const FileGroup *> languageFallbacks;
|
||||
|
||||
for (const FileGroup *group : Utils::asConst(target->fileGroups)) {
|
||||
for (const FileGroup *group : qAsConst(target->fileGroups)) {
|
||||
if (group->includePaths.isEmpty() && group->compileFlags.isEmpty()
|
||||
&& group->macros.isEmpty())
|
||||
continue;
|
||||
@@ -803,7 +802,7 @@ void ServerModeReader::addTargets(const QHash<Utils::FileName, ProjectExplorer::
|
||||
// Set up a default target path:
|
||||
FileName targetPath = t->sourceDirectory;
|
||||
targetPath.appendPath("CMakeLists.txt");
|
||||
for (CrossReference *cr : Utils::asConst(t->crossReferences)) {
|
||||
for (CrossReference *cr : qAsConst(t->crossReferences)) {
|
||||
BacktraceItem *bt = cr->backtrace.isEmpty() ? nullptr : cr->backtrace.at(0);
|
||||
if (bt) {
|
||||
const QString btName = bt->name.toLower();
|
||||
|
||||
Reference in New Issue
Block a user